dpyMwRouter.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 /********************************************************************************
9  ********************************** INCLUDES ************************************
10  ********************************************************************************/
11 
12 #include <azmq/socket.hpp>
13 #include <azmq/message.hpp>
14 #include <azmq/util/scope_guard.hpp>
15 
16 #include <boost/shared_ptr.hpp>
17 #include <boost/asio.hpp>
18 #include <boost/bind.hpp>
19 #include <boost/function.hpp>
20 #include <boost/enable_shared_from_this.hpp>
21 
27 
28 public boost::enable_shared_from_this<DpyMwRouter>
29 {
30  /********************************************************************************
31  ***************************** PUBLIC FUNCTIONS *********************************
32  ********************************************************************************/
33 public:
34  DpyMwRouter(boost::asio::io_service& io, std::string routerUrl);
35  ~DpyMwRouter();
36  void start();
37  void stop();
38  void doAsyncReceive();
39  void doSend(std::string idDealer, std::string payload);
40 
41  /********************************************************************************
42  **************************** PRIVATE VARIABLES *********************************
43  ********************************************************************************/
44 private:
45  boost::asio::io_service& mIo;
46  azmq::router_socket m_routerSocket;
47  std::string m_dpyMwRouterUrl;
48  bool m_working;
49  std::string m_message_router_id;
50  std::string m_message_router_payload;
52  /********************************************************************************
53  **************************** PUBLIC VARIABLES *********************************
54  ********************************************************************************/
55 public:
56  std::function<void(const std::string &id, const std::string &payload)> m_handler;
58 };
std::function< void(const std::string &id, const std::string &payload)> m_handler
Handler function to call from the service.
Definition: dpyMwRouter.h:56
Router class.
Definition: dpyMwRouter.h:26