m2etis
0.4
|
#include <SpreaditRouting.h>
Public Types | |
typedef message::SpreadItRoutingInfo< NetworkType > | RoutingInfoType |
typedef std::pair< uint64_t, typename NetworkType::Key > | TimePair |
typedef std::vector< typename NetworkType::Key > | KeyList |
typedef std::vector< TimePair > | TimeList |
Public Member Functions | |
SpreaditRouting (unsigned int topic_name, PubSubSystemEnvironment *pssi, const typename NetworkType::Key &root) | |
virtual | ~SpreaditRouting () |
void | setSelf (const typename NetworkType::Key &self) |
void | setUnsubscriptionListener (const boost::function< void(const typename NetworkType::Key)> &listener) |
void | selfSubscribed (const bool b) |
bool | selfSubscribed () const |
void | configureRoutingInfo (message::ActionType &msgType, typename message::RoutingInfo< NetworkType >::Ptr routingInfo, typename NetworkType::Key &) |
KeyList | getTargetNodes (const message::ActionType mtype, typename message::RoutingInfo< NetworkType >::Ptr routingInfo, typename NetworkType::Key &receiver) const |
bool | processSubscribePayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType) override |
void | processUnsubscribePayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType) |
void | processPublishPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &, typename NetworkType::Key &, message::ActionType &msgType) |
void | processNotifyPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &, typename NetworkType::Key &, message::ActionType &) |
void | processControlPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType) |
Public Member Functions inherited from m2etis::pubsub::routing::BaseRouting< NetworkType > | |
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... | |
Public Attributes | |
const uint64_t | periodic_ |
const uint64_t | purge_distance_ |
PubSubSystemEnvironment * | _pssi |
boost::function< void(const typename NetworkType::Key)> | removed_subscriber_eventlistener_ |
uint64_t | purgeID_ |
Static Public Attributes | |
static const bool | register_forward_subscribe |
static const bool | register_deliver_subscribe |
static const bool | register_forward_unsubscribe |
static const bool | register_deliver_unsubscribe |
static const bool | periodicSubscribtion |
Additional Inherited Members | |
Protected Attributes inherited from m2etis::pubsub::routing::BaseRouting< NetworkType > | |
boost::function< void(typename message::RoutingInfo< NetworkType >::Ptr, typename NetworkType::Key, ControlTarget)> | sendCtrlMsg_ |
Definition at line 42 of file SpreaditRouting.h.
typedef std::vector<typename NetworkType::Key> m2etis::pubsub::routing::SpreaditRouting< NetworkType >::KeyList |
Definition at line 46 of file SpreaditRouting.h.
typedef message::SpreadItRoutingInfo<NetworkType> m2etis::pubsub::routing::SpreaditRouting< NetworkType >::RoutingInfoType |
Definition at line 44 of file SpreaditRouting.h.
typedef std::vector<TimePair> m2etis::pubsub::routing::SpreaditRouting< NetworkType >::TimeList |
Definition at line 47 of file SpreaditRouting.h.
typedef std::pair<uint64_t, typename NetworkType::Key> m2etis::pubsub::routing::SpreaditRouting< NetworkType >::TimePair |
Definition at line 45 of file SpreaditRouting.h.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 114 of file SpreaditRouting.h.
|
inlinevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 146 of file SpreaditRouting.h.
|
inlinevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 295 of file SpreaditRouting.h.
|
inlinevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 289 of file SpreaditRouting.h.
|
inlinevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 285 of file SpreaditRouting.h.
|
inlineoverridevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 224 of file SpreaditRouting.h.
|
inlinevirtual |
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 |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 263 of file SpreaditRouting.h.
|
inline |
Definition at line 105 of file SpreaditRouting.h.
|
inline |
Definition at line 110 of file SpreaditRouting.h.
|
inline |
Definition at line 96 of file SpreaditRouting.h.
|
inlinevirtual |
Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.
Definition at line 100 of file SpreaditRouting.h.
PubSubSystemEnvironment* m2etis::pubsub::routing::SpreaditRouting< NetworkType >::_pssi |
Definition at line 74 of file SpreaditRouting.h.
const uint64_t m2etis::pubsub::routing::SpreaditRouting< NetworkType >::periodic_ |
Definition at line 69 of file SpreaditRouting.h.
|
static |
Definition at line 66 of file SpreaditRouting.h.
const uint64_t m2etis::pubsub::routing::SpreaditRouting< NetworkType >::purge_distance_ |
Definition at line 72 of file SpreaditRouting.h.
uint64_t m2etis::pubsub::routing::SpreaditRouting< NetworkType >::purgeID_ |
Definition at line 80 of file SpreaditRouting.h.
|
static |
Definition at line 56 of file SpreaditRouting.h.
|
static |
Definition at line 62 of file SpreaditRouting.h.
|
static |
Definition at line 53 of file SpreaditRouting.h.
|
static |
Definition at line 59 of file SpreaditRouting.h.
boost::function<void(const typename NetworkType::Key)> m2etis::pubsub::routing::SpreaditRouting< NetworkType >::removed_subscriber_eventlistener_ |
Definition at line 78 of file SpreaditRouting.h.