neic-glass3  1.4.6
brokerOutput.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 BROKEROUTPUT_H
8 #define BROKEROUTPUT_H
9 
10 #include <json.h>
11 #include <output.h>
12 #include <Producer.h>
13 
14 #include <mutex>
15 #include <string>
16 #include <vector>
17 #include <memory>
18 
19 #include "outputTopic.h"
20 
21 namespace glass3 {
22 
34  public:
41  brokerOutput();
42 
53  explicit brokerOutput(const std::shared_ptr<json::Object> &config);
54 
61  ~brokerOutput();
62 
72  bool setup(std::shared_ptr<const json::Object> config) override;
73 
80  void clear() override;
81 
86  void setStationFileName(const std::string &filename);
87 
92  const std::string getStationFileName();
93 
100  void logProducer(const std::string &message);
101 
102  protected:
112  void sendOutput(const std::string &type, const std::string &id,
113  const std::string &message) override;
114 
119  void sendToOutputTopics(const std::string &message);
120 
127  void sendHeartbeat() override;
128 
129  private:
133  std::vector<glass3::outputTopic*> m_vOutputTopics;
134 
139  hazdevbroker::Producer * m_StationRequestProducer;
140 
144  RdKafka::Topic * m_StationRequestTopic;
145 
149  std::string m_sStationFileName;
150 
155  std::mutex & getMutex();
156 
160  std::mutex m_Mutex;
161 };
162 } // namespace glass3
163 #endif // BROKEROUTPUT_H
void clear() override
brokerOutput clear function
Definition: brokerOutput.cpp:284
bool setup(std::shared_ptr< const json::Object > config) override
brokerOutput configuration function
Definition: brokerOutput.cpp:75
~brokerOutput()
brokerOutput destructor
Definition: brokerOutput.cpp:56
void sendToOutputTopics(const std::string &message)
Sends the provided message to each of the output topics.
Definition: brokerOutput.cpp:367
const std::string getStationFileName()
Gets the station file name.
Definition: brokerOutput.cpp:504
glass3 broker output class
Definition: brokerOutput.h:33
void setStationFileName(const std::string &filename)
Sets the station file name.
Definition: brokerOutput.cpp:498
The neic-glass3 project namespace containing all the classes and functions that make up neic-glass3...
void logProducer(const std::string &message)
the function for producer logging This function is used by the HazDevBroker producer to log messages ...
Definition: brokerOutput.cpp:491
brokerOutput()
brokerOutput constructor
Definition: brokerOutput.cpp:24
glass output class
Definition: output.h:74
void sendHeartbeat() override
Send heartbeats.
Definition: brokerOutput.cpp:481
void sendOutput(const std::string &type, const std::string &id, const std::string &message) override
output sending function
Definition: brokerOutput.cpp:295