defTypes.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 /********************************************************************************
13  ********************************* INCLUDES *************************************
14  ********************************************************************************/
15 #include <boost/function.hpp>
16 #include <boost/any.hpp>
17 #include <map>
18 
19 #ifndef MESSAGE
20 #define MESSAGE
21 
24 struct message
25 {
26  std::string ID;
27  std::string payload;
28 };
29 
30 #endif
31 
37 typedef boost::function<void(const std::string&, std::string)> f_proto_message;
38 
44 typedef std::map<uint64_t, f_proto_message> map_proto_register;
45 
50 typedef boost::function<void(const std::string&, std::string, int id)> f_proto_message_messID;
51 
57 typedef std::map<uint64_t, f_proto_message_messID> map_proto_register_messID;
58 
59 //When the sender ID is not needed (i.e. Dealer receives a msg from a router)
64 typedef boost::function<void(const std::string&)> f_proto_message_noID;
65 
71 typedef std::map<uint64_t, f_proto_message_noID> map_proto_register_noID;
72 
77 typedef boost::function<void(const std::string&, int id)> f_proto_message_noID_messID;
78 
84 typedef std::map<uint64_t, f_proto_message_noID_messID> map_proto_register_noID_messID;
85 
93 typedef boost::function<void(const std::string&, const std::string&, int, int)> f_proto_message_new;
94 
100 typedef std::map<uint64_t, f_proto_message_new> map_proto_register_new;
101 
109 typedef boost::function<void(const std::string&, const std::string&, boost::any, int)> f_proto_message_handler;
110 
116 typedef std::map<uint64_t, f_proto_message_handler> map_proto_register_handler;
117 
121 typedef std::function<void(int id_message)> dpy_mw_routerHandlerFunc_t;
122 
126 typedef std::map<int, message> map_messages;
127 
131 typedef std::map<int, std::string> map_messages_string;
struct to keep a message from a sender
Definition: defTypes.h:24
boost::function< void(const std::string &, const std::string &, int, int)> f_proto_message_new
Lambda function to be called depending on the message received.
Definition: defTypes.h:93
std::map< uint64_t, f_proto_message_noID_messID > map_proto_register_noID_messID
Map to keep functions with a type of message associated.
Definition: defTypes.h:84
boost::function< void(const std::string &)> f_proto_message_noID
Lambda function to be called depending on the message received.
Definition: defTypes.h:64
std::map< int, message > map_messages
Map to keep messages structs (second) with an ID (first) associated.
Definition: defTypes.h:126
std::string payload
message payload
Definition: defTypes.h:27
boost::function< void(const std::string &, std::string)> f_proto_message
Lambda function to be called depending on the message received.
Definition: defTypes.h:37
std::map< uint64_t, f_proto_message_new > map_proto_register_new
Map to keep functions with a type of message associated.
Definition: defTypes.h:100
std::map< uint64_t, f_proto_message > map_proto_register
Map to keep functions with a type of message associated.
Definition: defTypes.h:44
std::map< uint64_t, f_proto_message_handler > map_proto_register_handler
Map to keep functions with a type of message associated.
Definition: defTypes.h:116
std::map< uint64_t, f_proto_message_noID > map_proto_register_noID
Map to keep functions with a type of message associated.
Definition: defTypes.h:71
std::map< uint64_t, f_proto_message_messID > map_proto_register_messID
Map to keep functions with a type of message associated.
Definition: defTypes.h:57
boost::function< void(const std::string &, int id)> f_proto_message_noID_messID
Lambda function to be called depending on the message received.
Definition: defTypes.h:77
boost::function< void(const std::string &, std::string, int id)> f_proto_message_messID
Lambda function to be called depending on the message received.
Definition: defTypes.h:50
std::map< int, std::string > map_messages_string
Map to keep messages (second) with an ID (first) associated when the sender ID is not needed...
Definition: defTypes.h:131
boost::function< void(const std::string &, const std::string &, boost::any, int)> f_proto_message_handler
Lambda function to be called depending on the message received.
Definition: defTypes.h:109
std::string ID
sender ID
Definition: defTypes.h:26
std::function< void(int id_message)> dpy_mw_routerHandlerFunc_t
Handler function.
Definition: defTypes.h:121