src.dualinventive.com/dinet/sec-multi-proxy/include/zeromq/PublishInterface.h

36 lines
807 B
C++

/*
* PubSub.h
*
* Created on: Apr 23, 2015
* Author: rheijden
*/
#ifndef INCLUDE_ZEROMQ_PUBLISHINTERFACE_H_
#define INCLUDE_ZEROMQ_PUBLISHINTERFACE_H_
#include <string>
#include <memory>
#include <mutex>
#include <di/Zmq.h>
class PublishInterface {
public:
/**
* constructor for request reply
* @param cfg config for the Request reply socket
* @param l pointer to logging interface
*/
explicit PublishInterface(const std::shared_ptr<Di::Configuration> &cfg);
~PublishInterface();
void send(const std::shared_ptr<struct Message> &msg);
void send(const std::string &msg);
private:
std::mutex __sendLock; /**< RPC message object */
std::shared_ptr<Di::Zmq::Context> __zmqContext;
std::shared_ptr<Di::Zmq::Socket> __zmqSocket;
};
#endif // INCLUDE_ZEROMQ_PUBLISHINTERFACE_H_