m2etis  0.4
m2etis::pubsub::routing::BaseRouting< NetworkType > Class Template Referenceabstract

#include <BaseRouting.h>

Inheritance diagram for m2etis::pubsub::routing::BaseRouting< NetworkType >:
Inheritance graph

Public Member Functions

 BaseRouting (unsigned int, PubSubSystemEnvironment *)
 
virtual ~BaseRouting ()
 
void configureSendCallback (const boost::function< void(typename message::RoutingInfo< NetworkType >::Ptr, const typename NetworkType::Key &, ControlTarget)> &func)
 with this function, new messages can be sent directly to nodes More...
 
virtual bool processSubscribePayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)=0
 
virtual void processUnsubscribePayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)=0
 
virtual void processPublishPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)=0
 
virtual void processNotifyPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)=0
 
virtual void processControlPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)=0
 
virtual KeyList getTargetNodes (const message::ActionType mtype, typename message::RoutingInfo< NetworkType >::Ptr routingInfo, typename NetworkType::Key &receiver) const =0
 
virtual void configureRoutingInfo (message::ActionType &msgType, typename message::RoutingInfo< NetworkType >::Ptr routingInfo, typename NetworkType::Key &receiver)=0
 
virtual void setUnsubscriptionListener (const boost::function< void(const typename NetworkType::Key)> &listener)=0
 

Protected Attributes

boost::function< void(typename message::RoutingInfo< NetworkType >::Ptr, typename NetworkType::Key, ControlTarget)> sendCtrlMsg_
 

Detailed Description

template<class NetworkType>
class m2etis::pubsub::routing::BaseRouting< NetworkType >

Definition at line 37 of file BaseRouting.h.

Constructor & Destructor Documentation

template<class NetworkType >
m2etis::pubsub::routing::BaseRouting< NetworkType >::BaseRouting ( unsigned  int,
PubSubSystemEnvironment  
)
inline

Definition at line 41 of file BaseRouting.h.

template<class NetworkType >
virtual m2etis::pubsub::routing::BaseRouting< NetworkType >::~BaseRouting ( )
inlinevirtual

Definition at line 44 of file BaseRouting.h.

Member Function Documentation

template<class NetworkType >
virtual void m2etis::pubsub::routing::BaseRouting< NetworkType >::configureRoutingInfo ( message::ActionType msgType,
typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
typename NetworkType::Key &  receiver 
)
pure virtual

Configures the periodic messages. Every node runs a thread that triggers subscribe messages. These messages are used for periodical tasks like heart beat, checking the cluster size etc. This means that the message is not always from type subscribe or does not have the same subscription information. Every strategy chooses how to use the periodic messages and can configure it in this function.

Parameters
mtypeType of message to configure for
routingInfoobject to be configured with the necessary routing information

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::ScribeRouting< NetworkType >, and m2etis::pubsub::routing::DirectRouting< NetworkType >.

template<class NetworkType >
void m2etis::pubsub::routing::BaseRouting< NetworkType >::configureSendCallback ( const boost::function< void(typename message::RoutingInfo< NetworkType >::Ptr, const typename NetworkType::Key &, ControlTarget)> &  func)
inline

with this function, new messages can be sent directly to nodes

Definition at line 50 of file BaseRouting.h.

template<class NetworkType >
virtual KeyList m2etis::pubsub::routing::BaseRouting< NetworkType >::getTargetNodes ( const message::ActionType  mtype,
typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
typename NetworkType::Key &  receiver 
) const
pure virtual

Returns a list of target nodes for the specified message type and action coomand in regard to the node's position in the logic distribution tree.

Parameters
mtypethe type of the message (SUBSCRIBE, UNSUBSCIBE, CONTROL or PUBLISH)
routingInfocontains the action command and sometimes possible target nodes

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::DirectRouting< NetworkType >, and m2etis::pubsub::routing::ScribeRouting< NetworkType >.

template<class NetworkType >
virtual void m2etis::pubsub::routing::BaseRouting< NetworkType >::processControlPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
pure virtual

Handles a control message. The routing information of this node is updated, a decision about continuing the workflow is made and saved in a routingInfo object together with the necessary information. Control messages are used by routing strategies, that do not build the tree implicitly with subscribe messages, but need more complex control commands.

Parameters
routingInfocontains routing information provided by the sender, will be updated with routing decisions
senderthe senders's key

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::DirectRouting< NetworkType >, and m2etis::pubsub::routing::ScribeRouting< NetworkType >.

template<class NetworkType >
virtual void m2etis::pubsub::routing::BaseRouting< NetworkType >::processNotifyPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
pure virtual

Handles a notify message. Most strategies do not do anything, however such messages could affect the tree structure and every strategy should choose on its own what to do.

Parameters
routingInfocontains routing information provided by the sender, will be updated
senderthe senders's key

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::DirectRouting< NetworkType >, and m2etis::pubsub::routing::ScribeRouting< NetworkType >.

template<class NetworkType >
virtual void m2etis::pubsub::routing::BaseRouting< NetworkType >::processPublishPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
pure virtual

Handles a publish message. Most strategies do not do anything, however such messages could affect the tree structure and every strategy should choose on its own what to do.

Parameters
routingInfocontains routing information provided by the sender, will be updated
senderthe senders's key

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::DirectRouting< NetworkType >, and m2etis::pubsub::routing::ScribeRouting< NetworkType >.

template<class NetworkType >
virtual bool m2etis::pubsub::routing::BaseRouting< NetworkType >::processSubscribePayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
pure virtual

Handles a subscribe message. The routing information of this node is updated, a decision about continuing the workflow is made and saved in a routingInfo object together with the necessary information.

Parameters
routingInfocontains routing information provided, will be updated with routing decisions
senderthe senders's key

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::DirectRouting< NetworkType >, and m2etis::pubsub::routing::ScribeRouting< NetworkType >.

template<class NetworkType >
virtual void m2etis::pubsub::routing::BaseRouting< NetworkType >::processUnsubscribePayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
pure virtual

Handles an unsubscribe message. The routing information of this node is updated, a decision about continuing the workflow is made and saved in a routingInfo object together with the necessary information.

Parameters
routingInfocontains routing information provided by the sender, will be updated
senderthe senders's key

Implemented in m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >, m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >, m2etis::pubsub::routing::SpreaditRouting< NetworkType >, m2etis::pubsub::routing::DirectRouting< NetworkType >, and m2etis::pubsub::routing::ScribeRouting< NetworkType >.

Member Data Documentation

template<class NetworkType >
boost::function<void(typename message::RoutingInfo<NetworkType>::Ptr, typename NetworkType::Key, ControlTarget)> m2etis::pubsub::routing::BaseRouting< NetworkType >::sendCtrlMsg_
protected

Definition at line 124 of file BaseRouting.h.


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