ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
socket_wrapper_base.h
1 #ifndef RECODEX_BROKER_SOCKET_WRAPPER_BASE_HPP
2 #define RECODEX_BROKER_SOCKET_WRAPPER_BASE_HPP
3 
4 #include <memory>
5 #include <zmq.hpp>
6 
7 #include "message_container.h"
8 
15 {
16 protected:
20  zmq::socket_t socket_;
21 
25  const std::string addr_;
26 
30  const bool bound_;
31 
32 public:
40  std::shared_ptr<zmq::context_t> context, zmq::socket_type type, const std::string &addr, const bool bound);
41 
45  virtual ~socket_wrapper_base();
46 
51  zmq_pollitem_t get_pollitem();
52 
56  virtual void initialize();
57 
61  void restart();
62 
67  virtual bool send_message(const message_container &) = 0;
68 
73  virtual bool receive_message(message_container &) = 0;
74 };
75 
76 
77 #endif // RECODEX_BROKER_SOCKET_WRAPPER_BASE_HPP
virtual bool send_message(const message_container &)=0
zmq_pollitem_t get_pollitem()
const std::string addr_
socket_wrapper_base(std::shared_ptr< zmq::context_t > context, zmq::socket_type type, const std::string &addr, const bool bound)
virtual bool receive_message(message_container &)=0