dpyMwDealer.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 
22 namespace asio = boost::asio;
27 class DpyMwDealer: public boost::enable_shared_from_this<DpyMwDealer>
28 {
29 
30  /********************************************************************************
31  ***************************** PUBLIC FUNCTIONS *********************************
32  ********************************************************************************/
33 public:
34  DpyMwDealer(boost::asio::io_service& io, std::string routerUrl);
35  ~DpyMwDealer();
36  void start();
37  void stop();
38  void restart();
39  void sendData(std::string msg);
40 
41  /********************************************************************************
42  ***************************** PRIVATE FUNCTIONS *********************************
43  ********************************************************************************/
44 private:
45  void doAsyncReceive();
46 
47  /********************************************************************************
48  **************************** PRIVATE VARIABLES *********************************
49  ********************************************************************************/
50 private:
51  boost::asio::io_service& mIo;
52  azmq::dealer_socket m_dealerSocket;
53  std::string m_RouterUrl;
54  bool m_working;
55  std::string m_message_router;
57  /********************************************************************************
58  **************************** PUBLIC VARIABLES *********************************
59  ********************************************************************************/
60 public:
61  std::function<void(const std::string&)> m_handler;
63 };
Dealer class.
Definition: dpyMwDealer.h:27
std::function< void(const std::string &)> m_handler
Handler function to call from the service.
Definition: dpyMwDealer.h:61