neic-glass3  1.4.6
outputTopic.h
Go to the documentation of this file.
1 /*****************************************
2  * This file is documented for Doxygen.
3  * If you modify this file please update
4  * the comments so that Doxygen will still
5  * be able to work.
6  ****************************************/
7 #ifndef OUTPUTTOPIC_H
8 #define OUTPUTTOPIC_H
9 
10 #include <json.h>
11 #include <Producer.h>
12 
13 #include <string>
14 
15 namespace glass3 {
16 
23 class outputTopic {
24  public:
34  explicit outputTopic(hazdevbroker::Producer * producer);
35 
41  ~outputTopic();
42 
52  bool setup(const json::Value &config);
53 
60  void clear();
61 
72  bool isInBounds(double lat, double lon);
73 
80  void send(const std::string &message);
81 
88  void heartbeat();
89 
90  protected:
95 
100 
105 
110 
114  std::string m_sTopicName;
115 
116  private:
120  RdKafka::Topic * m_OutputTopic;
121 
125  hazdevbroker::Producer * m_OutputProducer;
126 
131  double m_dSendTime;
132 
137  int m_iRunningAverageCounter;
138 
143  double m_dRunningSendTimeAverage;
144 
149  int m_iMessageCounter;
150 
154  time_t tLastPerformanceReport;
155 
162  int m_iReportInterval;
163 };
164 } // namespace glass3
165 #endif // OUTPUTTOPIC_H
double m_dRightLongitude
the right side of the bounds rectangle in degrees of longitude.
Definition: outputTopic.h:109
double m_dTopLatitude
the top of the bounds rectangle in degrees of latitude.
Definition: outputTopic.h:94
std::string m_sTopicName
the std::string containing the topic name
Definition: outputTopic.h:114
glass3 output topic class
Definition: outputTopic.h:23
outputTopic(hazdevbroker::Producer *producer)
outputTopic constructor
Definition: outputTopic.cpp:12
The neic-glass3 project namespace containing all the classes and functions that make up neic-glass3...
void send(const std::string &message)
outputTopic send function The function sends the provided message using the producer pointer and the ...
Definition: outputTopic.cpp:187
bool setup(const json::Value &config)
outputTopic configuration function
Definition: outputTopic.cpp:34
bool isInBounds(double lat, double lon)
outputTopic bounds check function
Definition: outputTopic.cpp:177
double m_dBottomLatitude
the bottom of the bounds rectangle in degrees of latitude.
Definition: outputTopic.h:99
double m_dLeftLongitude
the left side of the bounds rectangle in degrees of longitude.
Definition: outputTopic.h:104
void clear()
outputTopic clear function
Definition: outputTopic.cpp:158
~outputTopic()
outputTopic destructor
Definition: outputTopic.cpp:29
void heartbeat()
outputTopic heartbeat function The function sends generates a heartbeat using the producer pointer an...
Definition: outputTopic.cpp:276