Public Member Functions | Private Types | Private Attributes | List of all members
mm_radio::impl::Radio Class Reference

#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, BufferCallbackFunctionSubscriberMap
 
typedef std::map< unsigned int, BufferCallbackFunction >::const_iterator SubscriberMapConstIterator
 
typedef std::map< unsigned int, BufferCallbackFunction >::iterator SubscriberMapIterator
 
typedef std::pair< unsigned int, BufferCallbackFunctionSubscriberMapPair
 
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
 

Detailed Description

Definition at line 34 of file radio.hpp.

Member Typedef Documentation

typedef ecl::BinaryFunction<const unsigned char*,const unsigned int&,void>* mm_radio::impl::Radio::BufferCallbackFunction
private

Definition at line 76 of file radio.hpp.

typedef std::map<unsigned int, BufferCallbackFunction> mm_radio::impl::Radio::SubscriberMap
private

Definition at line 77 of file radio.hpp.

typedef std::map<unsigned int, BufferCallbackFunction>::const_iterator mm_radio::impl::Radio::SubscriberMapConstIterator
private

Definition at line 79 of file radio.hpp.

typedef std::map<unsigned int, BufferCallbackFunction>::iterator mm_radio::impl::Radio::SubscriberMapIterator
private

Definition at line 78 of file radio.hpp.

typedef std::pair<unsigned int, BufferCallbackFunction> mm_radio::impl::Radio::SubscriberMapPair
private

Definition at line 80 of file radio.hpp.

typedef std::pair<std::map<unsigned int, BufferCallbackFunction>::iterator,bool> mm_radio::impl::Radio::SubscriberMapResultPair
private

Definition at line 81 of file radio.hpp.

Constructor & Destructor Documentation

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.

mm_radio::impl::Radio::~Radio ( )

Definition at line 89 of file lib/radio.cpp.

Member Function Documentation

template<typename C >
void mm_radio::impl::Radio::registerSubscriber ( const unsigned int &  id,
void(C::*)(const unsigned char *, const unsigned int &)  processPacket,
C &  s 
)
inline

Definition at line 59 of file radio.hpp.

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.

Member Data Documentation

int mm_radio::impl::Radio::endpoint_id
private

Definition at line 84 of file radio.hpp.

ecl::Mutex mm_radio::impl::Radio::mutex
private

Definition at line 89 of file radio.hpp.

std::string mm_radio::impl::Radio::name
private

Definition at line 83 of file radio.hpp.

bool mm_radio::impl::Radio::shutdown_requested
private

Definition at line 86 of file radio.hpp.

int mm_radio::impl::Radio::socket
private

Definition at line 84 of file radio.hpp.

SubscriberMap mm_radio::impl::Radio::subscribers
private

Definition at line 88 of file radio.hpp.

ecl::Thread mm_radio::impl::Radio::thread
private

Definition at line 87 of file radio.hpp.

std::string mm_radio::impl::Radio::url
private

Definition at line 83 of file radio.hpp.

mm_messages::Verbosity::Level mm_radio::impl::Radio::verbosity
private

Definition at line 85 of file radio.hpp.


The documentation for this class was generated from the following files:


mm_radio
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:52:16