Public Types | Static Public Member Functions
mm_mux_demux::MessageDemux Class Reference

#include <demux.hpp>

List of all members.

Public Types

typedef std::map< std::string,
std::shared_ptr
< impl::MessageDemux > > 
DemuxMap
typedef std::map< std::string,
std::shared_ptr
< impl::MessageDemux >
>::const_iterator 
DemuxMapConstIterator
typedef std::map< std::string,
std::shared_ptr
< impl::MessageDemux >
>::iterator 
DemuxMapIterator
typedef std::pair< std::string,
std::shared_ptr
< impl::MessageDemux > > 
DemuxMapPair

Static Public Member Functions

static DemuxMapdemultiplexers ()
 Store demux's in an invisible storage location.
template<typename C >
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.
static void shutdown ()
static void shutdown (const std::string &name)
static void start (const std::string &name, const std::string &url, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET, const bool bind=false)
static void unregisterSubscriber (const std::string &name, const unsigned int &id)

Detailed Description

Definition at line 99 of file demux.hpp.


Member Typedef Documentation

typedef std::map<std::string, std::shared_ptr<impl::MessageDemux> > mm_mux_demux::MessageDemux::DemuxMap

Definition at line 101 of file demux.hpp.

typedef std::map<std::string, std::shared_ptr<impl::MessageDemux> >::const_iterator mm_mux_demux::MessageDemux::DemuxMapConstIterator

Definition at line 104 of file demux.hpp.

typedef std::map<std::string, std::shared_ptr<impl::MessageDemux> >::iterator mm_mux_demux::MessageDemux::DemuxMapIterator

Definition at line 103 of file demux.hpp.

typedef std::pair<std::string, std::shared_ptr<impl::MessageDemux> > mm_mux_demux::MessageDemux::DemuxMapPair

Definition at line 102 of file demux.hpp.


Member Function Documentation

Store demux's in an invisible storage location.

This makes storage transparent for the user. Note that it will only allocate when first called.

Returns:

Definition at line 203 of file demux.cpp.

template<typename C >
static void mm_mux_demux::MessageDemux::registerSubscriber ( const std::string &  name,
const unsigned int &  id,
void(C::*)(const unsigned char *, const unsigned int &)  processPacket,
C &  s 
) [inline, static]

Register a callback with the specified demux.

Basically we just need a function that can handle const unsigned char* buffers.

Could make this more specific and specify 'template<typename DataType>' with 'Subscriber<DataType>' instead of 'C', but this keeps it open for creating new subscriber types.

Parameters:
name
id
processPacket
s

Definition at line 136 of file demux.hpp.

Definition at line 187 of file demux.cpp.

void mm_mux_demux::MessageDemux::shutdown ( const std::string &  name) [static]

Definition at line 195 of file demux.cpp.

void mm_mux_demux::MessageDemux::start ( const std::string &  name,
const std::string &  url,
const mm_messages::Verbosity::Level verbosity = mm_messages::Verbosity::QUIET,
const bool  bind = false 
) [static]

Definition at line 170 of file demux.cpp.

void mm_mux_demux::MessageDemux::unregisterSubscriber ( const std::string &  name,
const unsigned int &  id 
) [static]

Definition at line 209 of file demux.cpp.


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


mm_mux_demux
Author(s): Daniel Stonier
autogenerated on Thu Jun 6 2019 21:13:22