m2etis  0.4
m2etis::net::NetworkCallbackInterface< NetworkType > Class Template Referenceabstract

Generic interface for the callback-class used for the network. More...

#include <NetworkCallbackInterface.h>

Inheritance diagram for m2etis::net::NetworkCallbackInterface< NetworkType >:
Inheritance graph

Public Member Functions

 NetworkCallbackInterface ()
 
virtual ~NetworkCallbackInterface ()
 
virtual bool forward (typename message::NetworkMessage< NetworkType >::Ptr message, const typename NodeHandle< NetworkType >::Ptr hint)=0
 called if a message is forwarded by your node More...
 
virtual void deliver (typename message::NetworkMessage< NetworkType >::Ptr message)=0
 called if a message is delivered to your node. More...
 
virtual void update (const typename NetworkType::Key &key, const typename NodeHandle< NetworkType >::Ptr_const handle, bool joined)=0
 called on node joins or leaves More...
 

Detailed Description

template<class NetworkType>
class m2etis::net::NetworkCallbackInterface< NetworkType >

Generic interface for the callback-class used for the network.

Implement this class and pass it to KBR_API (or directly to the used wrapper). The callbacks will be called to inform you about actual network stuff and permit you to make own decisions.

Definition at line 43 of file NetworkCallbackInterface.h.

Constructor & Destructor Documentation

Definition at line 45 of file NetworkCallbackInterface.h.

template<class NetworkType>
virtual m2etis::net::NetworkCallbackInterface< NetworkType >::~NetworkCallbackInterface ( )
inlinevirtual

Definition at line 46 of file NetworkCallbackInterface.h.

Member Function Documentation

template<class NetworkType>
virtual bool m2etis::net::NetworkCallbackInterface< NetworkType >::forward ( typename message::NetworkMessage< NetworkType >::Ptr  message,
const typename NodeHandle< NetworkType >::Ptr  hint 
)
pure virtual

called if a message is forwarded by your node

details you can change the Key, the Message and the next routing hint. If you want to stop routing simply set hint to 0. Or you can change the key and the message. Like in scribe, when building a multicast tree. It's like NAT, change the Key and the Message :-)

Parameters
[in]messagethe message
[in]hintthe next routing hop
Returns
true if the routing must be stopped

Implemented in m2etis::net::NetworkController< NetworkType >, m2etis::net::NetworkController< m2etis::net::NetworkType< clockTCP > >, m2etis::net::NetworkController< m2etis::net::NetworkType< TCP > >, and m2etis::net::NetworkController< m2etis::net::NetworkType< UDP > >.

template<class NetworkType>
virtual void m2etis::net::NetworkCallbackInterface< NetworkType >::update ( const typename NetworkType::Key key,
const typename NodeHandle< NetworkType >::Ptr_const  handle,
bool  joined 
)
pure virtual

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