8 #ifndef mm_radio_RADIO_HPP_ 9 #define mm_radio_RADIO_HPP_ 37 const std::string&
url,
60 const unsigned int&
id,
61 void (C::*processPacket)(
const unsigned char*,
const unsigned int&),
107 typedef std::map<std::string, std::shared_ptr<impl::Radio>>
RadioMap;
108 typedef std::pair<std::string, std::shared_ptr<impl::Radio>>
RadioMapPair;
119 static void startServer(
const std::string&
name,
120 const std::string&
url,
122 static void startClient(
const std::string&
name,
123 const std::string&
url,
125 static RadioMap& radios();
154 const std::string&
name,
155 const unsigned int&
id,
156 void (C::*processPacket)(
const unsigned char*,
const unsigned int&),
163 std::cout <<
"Radio : no radio by that name found (while registering subscriber)"<< std::endl;
int send(const unsigned int &id, const mm_messages::ByteArray &msg_buffer)
void unregisterSubscriber(const unsigned int &id)
std::map< std::string, std::shared_ptr< impl::Radio > >::iterator RadioMapIterator
ecl::BinaryFunction< const unsigned char *, const unsigned int &, void > * BufferCallbackFunction
std::map< std::string, std::shared_ptr< impl::Radio > > RadioMap
std::pair< std::string, std::shared_ptr< impl::Radio > > RadioMapPair
std::map< unsigned int, BufferCallbackFunction > SubscriberMap
std::map< unsigned int, BufferCallbackFunction >::const_iterator SubscriberMapConstIterator
void registerSubscriber(const unsigned int &id, void(C::*processPacket)(const unsigned char *, const unsigned int &), C &s)
std::map< unsigned int, BufferCallbackFunction >::iterator SubscriberMapIterator
static RadioMap & radios()
Radio(const std::string &name, const std::string &url, const bool bind, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET)
mm_messages::Verbosity::Level verbosity
std::map< std::string, std::shared_ptr< impl::Radio > >::const_iterator RadioMapConstIterator
SubscriberMap subscribers
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.
std::vector< unsigned char > ByteArray
std::pair< std::map< unsigned int, BufferCallbackFunction >::iterator, bool > SubscriberMapResultPair
std::pair< unsigned int, BufferCallbackFunction > SubscriberMapPair