m2etis  0.4
m2etis::sim::OmNetMediator Class Reference

#include <OmNetMediator.h>

Inheritance diagram for m2etis::sim::OmNetMediator:
Inheritance graph

Public Member Functions

 OmNetMediator (const std::string &ip, const int port, const std::string &known_hostname, const int known_hostport)
 constructor More...
 
 ~OmNetMediator ()
 destructor More...
 
void registerOmNetCallback (OmNetCallbackInterface *o)
 method to register M2etisAdapter in here More...
 
void setCallback (net::NetworkCallbackInterface< net::NetworkType< net::OMNET >> *cb)
 sets callback of NetworkController to communicate with Tree More...
 
void send (const message::ActionType type, const std::string &to, const message::M2Message< SimulationEventType >::Ptr payload, net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr_const hint, unsigned int size)
 method to send the given message into the M2etisAdapter More...
 
void send (const net::NetworkType< net::OMNET >::Message::Ptr msg, net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr_const hint)
 method called by NetworkController to send message into the network More...
 
void send (const net::NetworkType< net::OMNET >::Message::Ptr msg)
 method called by NetworkController to send message into the network More...
 
net::NodeHandle< net::NetworkType< net::OMNET > >::Ptr getSelfNodeHandle () const
 returns this nodes NodeHandle More...
 
void registerMessageType (const message::ActionType type, const bool ack) const
 not used More...
 
void registerMessageType (const net::NetworkType< net::OMNET >::MessageType type, const bool ack) const
 not used More...
 
bool forward (std::string &key, message::M2Message< SimulationEventType >::Ptr msg, const net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr hint)
 method to forward message using an overlay More...
 
void deliver (message::NetworkMessage< net::NetworkType< net::OMNET >>::Ptr msg)
 method to deliver messages from M2etisAdapter More...
 
void update (const std::string &key, const net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr_const handle, bool joined)
 method called by M2etisAdapter to validate status in overlay More...
 
std::string getSHA1 (int channel_name)
 method to get SHA1 key out of channel name More...
 
bool isResponsibleFor (const net::NetworkType< net::OMNET >::Key &key, const net::NetworkType< net::OMNET >::Key &node) const
 returns whether one node is responsible for another More...
 
net::NetworkType< net::OMNET >::Key getRoot () const
 returns the root node of the tree More...
 
void registerWrapper (PubSubWrapper *p)
 registers the PubSubWrapper of this simulation node in the wrapper More...
 
- Public Member Functions inherited from m2etis::net::NetworkInterface< net::NetworkType< net::OMNET > >
virtual ~NetworkInterface ()
 
void setCallback (NetworkCallbackInterface< net::NetworkType< net::OMNET > > *cb)
 Sets the callback-object on which the defined callbacks will be called. More...
 
virtual void send (const typename message::NetworkMessage< net::NetworkType< net::OMNET > >::Ptr msg, typename NodeHandle< net::NetworkType< net::OMNET > >::Ptr_const hint)=0
 Sends a message to the node which is responsible for the given key. Provide a hint for better routing. More...
 

Additional Inherited Members

- Protected Attributes inherited from m2etis::net::NetworkInterface< net::NetworkType< net::OMNET > >
net::NetworkCallbackInterface< net::NetworkType< net::OMNET > > * _callback
 returns an array of count neighbor nodes with priority to closer nodes. More...
 

Detailed Description

Definition at line 44 of file OmNetMediator.h.

Constructor & Destructor Documentation

m2etis::sim::OmNetMediator::OmNetMediator ( const std::string &  ip,
const int  port,
const std::string &  known_hostname,
const int  known_hostport 
)
inline

constructor

Parameters
[in]iplocal IP of the node
[in]portlocal port of the node
[in]known_hostnameIP of the root node
[in]known_hostportport of the root node

Definition at line 54 of file OmNetMediator.h.

m2etis::sim::OmNetMediator::~OmNetMediator ( )
inline

destructor

Definition at line 60 of file OmNetMediator.h.

Member Function Documentation

void m2etis::sim::OmNetMediator::deliver ( message::NetworkMessage< net::NetworkType< net::OMNET >>::Ptr  msg)

method to deliver messages from M2etisAdapter

Parameters
[in]msgmessage received by M2etisAdapter
bool m2etis::sim::OmNetMediator::forward ( std::string &  key,
message::M2Message< SimulationEventType >::Ptr  msg,
const net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr  hint 
)

method to forward message using an overlay

[in] key key of a node [in] msg message being forwarded [in] hint NodeHandle

net::NetworkType<net::OMNET>::Key m2etis::sim::OmNetMediator::getRoot ( ) const
inline

returns the root node of the tree

Definition at line 160 of file OmNetMediator.h.

net::NodeHandle<net::NetworkType<net::OMNET> >::Ptr m2etis::sim::OmNetMediator::getSelfNodeHandle ( ) const
virtual

returns this nodes NodeHandle

Implements m2etis::net::NetworkInterface< net::NetworkType< net::OMNET > >.

std::string m2etis::sim::OmNetMediator::getSHA1 ( int  channel_name)

method to get SHA1 key out of channel name

Parameters
[in]channel_namethe topic for which the SHA1 key will be generated
bool m2etis::sim::OmNetMediator::isResponsibleFor ( const net::NetworkType< net::OMNET >::Key &  key,
const net::NetworkType< net::OMNET >::Key &  node 
) const

returns whether one node is responsible for another

Parameters
[in]keythe node being checked whether it is responsible
[in]nodethe node being the checked whether it isn't responsible
void m2etis::sim::OmNetMediator::registerMessageType ( const message::ActionType  type,
const bool  ack 
) const

not used

void m2etis::sim::OmNetMediator::registerMessageType ( const net::NetworkType< net::OMNET >::MessageType  type,
const bool  ack 
) const
virtual
void m2etis::sim::OmNetMediator::registerOmNetCallback ( OmNetCallbackInterface o)

method to register M2etisAdapter in here

Parameters
[in]othe base class of the M2etisAdapter known in m2etis library
void m2etis::sim::OmNetMediator::registerWrapper ( PubSubWrapper p)
inline

registers the PubSubWrapper of this simulation node in the wrapper

Parameters
[in]pthe pointer to the PubSubWrapper being registered

Definition at line 167 of file OmNetMediator.h.

void m2etis::sim::OmNetMediator::send ( const message::ActionType  type,
const std::string &  to,
const message::M2Message< SimulationEventType >::Ptr  payload,
net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr_const  hint,
unsigned int  size 
)

method to send the given message into the M2etisAdapter

Parameters
[in]typetype of the message
[in]toreceiver of this message
[in]payloadthe message to be sent
[in]hintNodeHandle
[in]sizethe size of the serialized message, needed for metric in M2etisAdapter
void m2etis::sim::OmNetMediator::send ( const net::NetworkType< net::OMNET >::Message::Ptr  msg,
net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr_const  hint 
)

method called by NetworkController to send message into the network

Parameters
[in]msgmessage to be sent
[in]hintNodeHandle
void m2etis::sim::OmNetMediator::send ( const net::NetworkType< net::OMNET >::Message::Ptr  msg)

method called by NetworkController to send message into the network

Parameters
[in]msgmessage to be sent
void m2etis::sim::OmNetMediator::setCallback ( net::NetworkCallbackInterface< net::NetworkType< net::OMNET >> *  cb)

sets callback of NetworkController to communicate with Tree

Parameters
[in]cbpointer to the NetworkController
void m2etis::sim::OmNetMediator::update ( const std::string &  key,
const net::NodeHandle< net::NetworkType< net::OMNET >>::Ptr_const  handle,
bool  joined 
)

method called by M2etisAdapter to validate status in overlay

Parameters
[in]keykey of the not being validated
[in]handleNodeHandle
[in]joinedflag whether the node joined or leaved

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