|
m2etis
0.4
|
#include <OmNetMediator.h>

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... | |
Definition at line 44 of file OmNetMediator.h.
|
inline |
constructor
| [in] | ip | local IP of the node |
| [in] | port | local port of the node |
| [in] | known_hostname | IP of the root node |
| [in] | known_hostport | port of the root node |
Definition at line 54 of file OmNetMediator.h.
|
inline |
destructor
Definition at line 60 of file OmNetMediator.h.
| void m2etis::sim::OmNetMediator::deliver | ( | message::NetworkMessage< net::NetworkType< net::OMNET >>::Ptr | msg | ) |
method to deliver messages from M2etisAdapter
| [in] | msg | message 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
|
inline |
returns the root node of the tree
Definition at line 160 of file OmNetMediator.h.
|
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
| [in] | channel_name | the 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
| [in] | key | the node being checked whether it is responsible |
| [in] | node | the node being the checked whether it isn't responsible |
| void m2etis::sim::OmNetMediator::registerMessageType | ( | const message::ActionType | type, |
| const bool | ack | ||
| ) | const |
not used
|
virtual |
not used
Implements m2etis::net::NetworkInterface< net::NetworkType< net::OMNET > >.
| void m2etis::sim::OmNetMediator::registerOmNetCallback | ( | OmNetCallbackInterface * | o | ) |
method to register M2etisAdapter in here
| [in] | o | the base class of the M2etisAdapter known in m2etis library |
|
inline |
registers the PubSubWrapper of this simulation node in the wrapper
| [in] | p | the 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
| [in] | type | type of the message |
| [in] | to | receiver of this message |
| [in] | payload | the message to be sent |
| [in] | hint | NodeHandle |
| [in] | size | the 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
| [in] | msg | message to be sent |
| [in] | hint | NodeHandle |
| void m2etis::sim::OmNetMediator::send | ( | const net::NetworkType< net::OMNET >::Message::Ptr | msg | ) |
method called by NetworkController to send message into the network
| [in] | msg | message to be sent |
| void m2etis::sim::OmNetMediator::setCallback | ( | net::NetworkCallbackInterface< net::NetworkType< net::OMNET >> * | cb | ) |
sets callback of NetworkController to communicate with Tree
| [in] | cb | pointer 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
| [in] | key | key of the not being validated |
| [in] | handle | NodeHandle |
| [in] | joined | flag whether the node joined or leaved |