#include <radio.hpp>
Public Member Functions | |
| Radio (const std::string &name, const std::string &url, const bool bind, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET) | |
| Radio (const Radio &other) | |
| template<typename C > | |
| void | registerSubscriber (const unsigned int &id, void(C::*processPacket)(const unsigned char *, const unsigned int &), C &s) |
| int | send (const unsigned int &id, const mm_messages::ByteArray &msg_buffer) |
| void | shutdown () |
| void | spin () |
| void | unregisterSubscriber (const unsigned int &id) |
| ~Radio () | |
Private Types | |
| typedef ecl::BinaryFunction < const unsigned char *, const unsigned int &, void > * | BufferCallbackFunction |
| typedef std::map< unsigned int, BufferCallbackFunction > | SubscriberMap |
| typedef std::map< unsigned int, BufferCallbackFunction > ::const_iterator | SubscriberMapConstIterator |
| typedef std::map< unsigned int, BufferCallbackFunction > ::iterator | SubscriberMapIterator |
| typedef std::pair< unsigned int, BufferCallbackFunction > | SubscriberMapPair |
| typedef std::pair< std::map < unsigned int, BufferCallbackFunction > ::iterator, bool > | SubscriberMapResultPair |
Private Attributes | |
| int | endpoint_id |
| ecl::Mutex | mutex |
| std::string | name |
| bool | shutdown_requested |
| int | socket |
| SubscriberMap | subscribers |
| ecl::Thread | thread |
| std::string | url |
| mm_messages::Verbosity::Level | verbosity |
typedef ecl::BinaryFunction<const unsigned char*,const unsigned int&,void>* mm_radio::impl::Radio::BufferCallbackFunction [private] |
typedef std::map<unsigned int, BufferCallbackFunction> mm_radio::impl::Radio::SubscriberMap [private] |
typedef std::map<unsigned int, BufferCallbackFunction>::const_iterator mm_radio::impl::Radio::SubscriberMapConstIterator [private] |
typedef std::map<unsigned int, BufferCallbackFunction>::iterator mm_radio::impl::Radio::SubscriberMapIterator [private] |
typedef std::pair<unsigned int, BufferCallbackFunction> mm_radio::impl::Radio::SubscriberMapPair [private] |
typedef std::pair<std::map<unsigned int, BufferCallbackFunction>::iterator,bool> mm_radio::impl::Radio::SubscriberMapResultPair [private] |
| mm_radio::impl::Radio::Radio | ( | const std::string & | name, |
| const std::string & | url, | ||
| const bool | bind, | ||
| const mm_messages::Verbosity::Level & | verbosity = mm_messages::Verbosity::QUIET |
||
| ) |
Definition at line 28 of file lib/radio.cpp.
| mm_radio::impl::Radio::Radio | ( | const Radio & | other | ) |
Definition at line 79 of file lib/radio.cpp.
Definition at line 89 of file lib/radio.cpp.
| void mm_radio::impl::Radio::registerSubscriber | ( | const unsigned int & | id, |
| void(C::*)(const unsigned char *, const unsigned int &) | processPacket, | ||
| C & | s | ||
| ) | [inline] |
| int mm_radio::impl::Radio::send | ( | const unsigned int & | id, |
| const mm_messages::ByteArray & | msg_buffer | ||
| ) |
Definition at line 166 of file lib/radio.cpp.
| void mm_radio::impl::Radio::shutdown | ( | ) |
Shutdown the socket. This currently doesn't shutdown the thread as nn_recv will block indefinitely. Even after nn_shutdown is called, it will hang around.
Definition at line 149 of file lib/radio.cpp.
| void mm_radio::impl::Radio::spin | ( | ) |
Definition at line 107 of file lib/radio.cpp.
| void mm_radio::impl::Radio::unregisterSubscriber | ( | const unsigned int & | id | ) |
Definition at line 159 of file lib/radio.cpp.
int mm_radio::impl::Radio::endpoint_id [private] |
ecl::Mutex mm_radio::impl::Radio::mutex [private] |
std::string mm_radio::impl::Radio::name [private] |
bool mm_radio::impl::Radio::shutdown_requested [private] |
int mm_radio::impl::Radio::socket [private] |
ecl::Thread mm_radio::impl::Radio::thread [private] |
std::string mm_radio::impl::Radio::url [private] |