m2etis
0.4
|
#include <BaseRouting.h>
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_ |
Definition at line 37 of file BaseRouting.h.
|
inline |
Definition at line 41 of file BaseRouting.h.
|
inlinevirtual |
Definition at line 44 of file BaseRouting.h.
|
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.
mtype | Type of message to configure for |
routingInfo | object 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 >.
|
inline |
with this function, new messages can be sent directly to nodes
Definition at line 50 of file BaseRouting.h.
|
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.
mtype | the type of the message (SUBSCRIBE, UNSUBSCIBE, CONTROL or PUBLISH) |
routingInfo | contains 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 >.
|
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.
routingInfo | contains routing information provided by the sender, will be updated with routing decisions |
sender | the 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 >.
|
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.
routingInfo | contains routing information provided by the sender, will be updated |
sender | the 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 >.
|
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.
routingInfo | contains routing information provided by the sender, will be updated |
sender | the 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 >.
|
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.
routingInfo | contains routing information provided, will be updated with routing decisions |
sender | the 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 >.
|
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.
routingInfo | contains routing information provided by the sender, will be updated |
sender | the 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 >.
|
pure virtual |
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 >.
|
protected |
Definition at line 124 of file BaseRouting.h.