10 #ifndef mm_mux_demux_DEMUX_HPP_ 11 #define mm_mux_demux_DEMUX_HPP_ 39 const std::string&
url,
41 const bool bind =
false 50 const unsigned int&
id,
51 void (C::*processPacket)(
const unsigned char*,
const unsigned int&),
101 typedef std::map<std::string, std::shared_ptr<impl::MessageDemux>>
DemuxMap;
102 typedef std::pair<std::string, std::shared_ptr<impl::MessageDemux>>
DemuxMapPair;
103 typedef std::map<std::string, std::shared_ptr<impl::MessageDemux>>::iterator
DemuxMapIterator;
106 static void start(
const std::string&
name,
107 const std::string&
url,
109 const bool bind =
false);
119 static DemuxMap& demultiplexers();
137 const std::string&
name,
138 const unsigned int&
id,
139 void (C::*processPacket)(
const unsigned char*,
const unsigned int&),
142 DemuxMapIterator iter = demultiplexers().find(name);
143 if ( iter != demultiplexers().end() ) {
146 std::cout <<
"Demux : no demux by that name found (while registering subscriber)"<< std::endl;
MessageDemux(const std::string &name, const std::string &url, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET, const bool bind=false)
std::pair< std::map< unsigned int, BufferCallbackFunction >::iterator, bool > SubscriberMapResultPair
std::pair< unsigned int, BufferCallbackFunction > SubscriberMapPair
ecl::BinaryFunction< const unsigned char *, const unsigned int &, void > * BufferCallbackFunction
std::map< std::string, std::shared_ptr< impl::MessageDemux > >::iterator DemuxMapIterator
static void registerSubscriber(const std::string &name, const unsigned int &id, void(C::*processPacket)(const unsigned char *, const unsigned int &), C &s)
Register a callback with the specified demux.
void unregisterSubscriber(const unsigned int &id)
mm_messages::Verbosity::Level verbosity
void registerSubscriber(const unsigned int &id, void(C::*processPacket)(const unsigned char *, const unsigned int &), C &s)
std::map< unsigned int, BufferCallbackFunction > SubscriberMap
SubscriberMap subscribers
std::pair< std::string, std::shared_ptr< impl::MessageDemux > > DemuxMapPair
std::map< std::string, std::shared_ptr< impl::MessageDemux > > DemuxMap
std::map< std::string, std::shared_ptr< impl::MessageDemux > >::const_iterator DemuxMapConstIterator
std::map< unsigned int, BufferCallbackFunction >::iterator SubscriberMapIterator
std::map< unsigned int, BufferCallbackFunction >::const_iterator SubscriberMapConstIterator
MessageDemux MessageClient