Public Member Functions | Private Types | Private Attributes | List of all members
mm_mux_demux::impl::MessageDemux Class Reference

#include <demux.hpp>

Public Member Functions

 MessageDemux (const std::string &name, const std::string &url, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET, const bool bind=false)
 
 MessageDemux (const MessageDemux &other)
 
template<typename C >
void registerSubscriber (const unsigned int &id, void(C::*processPacket)(const unsigned char *, const unsigned int &), C &s)
 
void shutdown ()
 
void spin ()
 
void unregisterSubscriber (const unsigned int &id)
 
 ~MessageDemux ()
 

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 36 of file demux.hpp.

Member Typedef Documentation

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

Definition at line 67 of file demux.hpp.

Definition at line 68 of file demux.hpp.

typedef std::map<unsigned int, BufferCallbackFunction>::const_iterator mm_mux_demux::impl::MessageDemux::SubscriberMapConstIterator
private

Definition at line 70 of file demux.hpp.

typedef std::map<unsigned int, BufferCallbackFunction>::iterator mm_mux_demux::impl::MessageDemux::SubscriberMapIterator
private

Definition at line 69 of file demux.hpp.

Definition at line 71 of file demux.hpp.

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

Definition at line 72 of file demux.hpp.

Constructor & Destructor Documentation

mm_mux_demux::impl::MessageDemux::MessageDemux ( const std::string &  name,
const std::string &  url,
const mm_messages::Verbosity::Level verbosity = mm_messages::Verbosity::QUIET,
const bool  bind = false 
)

Definition at line 28 of file demux.cpp.

mm_mux_demux::impl::MessageDemux::MessageDemux ( const MessageDemux other)

Definition at line 73 of file demux.cpp.

mm_mux_demux::impl::MessageDemux::~MessageDemux ( )

Definition at line 83 of file demux.cpp.

Member Function Documentation

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

Definition at line 49 of file demux.hpp.

void mm_mux_demux::impl::MessageDemux::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 140 of file demux.cpp.

void mm_mux_demux::impl::MessageDemux::spin ( )

Definition at line 99 of file demux.cpp.

void mm_mux_demux::impl::MessageDemux::unregisterSubscriber ( const unsigned int &  id)

Definition at line 150 of file demux.cpp.

Member Data Documentation

int mm_mux_demux::impl::MessageDemux::endpoint_id
private

Definition at line 77 of file demux.hpp.

ecl::Mutex mm_mux_demux::impl::MessageDemux::mutex
private

Definition at line 83 of file demux.hpp.

std::string mm_mux_demux::impl::MessageDemux::name
private

Definition at line 74 of file demux.hpp.

bool mm_mux_demux::impl::MessageDemux::shutdown_requested
private

Definition at line 79 of file demux.hpp.

int mm_mux_demux::impl::MessageDemux::socket
private

Definition at line 76 of file demux.hpp.

SubscriberMap mm_mux_demux::impl::MessageDemux::subscribers
private

Definition at line 82 of file demux.hpp.

ecl::Thread mm_mux_demux::impl::MessageDemux::thread
private

Definition at line 80 of file demux.hpp.

std::string mm_mux_demux::impl::MessageDemux::url
private

Definition at line 75 of file demux.hpp.

mm_messages::Verbosity::Level mm_mux_demux::impl::MessageDemux::verbosity
private

Definition at line 78 of file demux.hpp.


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


mm_mux_demux
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:52:14