m2etis  0.4
m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount > Class Template Reference

#include <HierarchicalSpreaditRouting.h>

Inheritance diagram for m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >:
Inheritance graph

Public Types

typedef message::HierarchicalSpreadItRoutingInfo< NetworkType > RoutingInfoType
 
typedef std::pair< long, typename NetworkType::Key > TimePair
 
typedef std::vector< typename NetworkType::Key > KeyList
 
typedef std::vector< TimePairTimeList
 

Public Member Functions

 HierarchicalSpreaditRouting (unsigned int topic_name, PubSubSystemEnvironment *pssi, const typename NetworkType::Key &root)
 
virtual ~HierarchicalSpreaditRouting ()
 
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 &receiver)
 
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 &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)
 
void processNotifyPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &receiver, message::ActionType &msgType)
 
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 long periodic_
 
const long purge_distance_
 
PubSubSystemEnvironment_pssi
 
boost::function< void(const typename NetworkType::Key)> removed_subscriber_eventlistener_
 
unsigned int 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_
 

Detailed Description

template<class NetworkType, unsigned int ChildAmount>
class m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >

Definition at line 42 of file HierarchicalSpreaditRouting.h.

Member Typedef Documentation

template<class NetworkType , unsigned int ChildAmount>
typedef std::vector<typename NetworkType::Key> m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::KeyList

Definition at line 46 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
typedef message::HierarchicalSpreadItRoutingInfo<NetworkType> m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::RoutingInfoType

Definition at line 44 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
typedef std::vector<TimePair> m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::TimeList

Definition at line 47 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
typedef std::pair<long, typename NetworkType::Key> m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::TimePair

Definition at line 45 of file HierarchicalSpreaditRouting.h.

Constructor & Destructor Documentation

template<class NetworkType , unsigned int ChildAmount>
m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::HierarchicalSpreaditRouting ( unsigned int  topic_name,
PubSubSystemEnvironment pssi,
const typename NetworkType::Key &  root 
)
inline

Definition at line 82 of file HierarchicalSpreaditRouting.h.

Here is the call graph for this function:

template<class NetworkType , unsigned int ChildAmount>
virtual m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::~HierarchicalSpreaditRouting ( )
inlinevirtual

Definition at line 91 of file HierarchicalSpreaditRouting.h.

Here is the call graph for this function:

Member Function Documentation

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::configureRoutingInfo ( message::ActionType msgType,
typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
typename NetworkType::Key &  receiver 
)
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 114 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
KeyList m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::getTargetNodes ( const message::ActionType  mtype,
typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
typename NetworkType::Key &  receiver 
) const
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 149 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::processControlPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 304 of file HierarchicalSpreaditRouting.h.

Here is the call graph for this function:

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::processNotifyPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 298 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::processPublishPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 294 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::processSubscribePayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 233 of file HierarchicalSpreaditRouting.h.

Here is the call graph for this function:

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::processUnsubscribePayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  receiver,
message::ActionType msgType 
)
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.

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

Implements m2etis::pubsub::routing::BaseRouting< NetworkType >.

Definition at line 272 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::selfSubscribed ( const bool  b)
inline

Definition at line 105 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::selfSubscribed ( ) const
inline

Definition at line 110 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::setSelf ( const typename NetworkType::Key &  self)
inline

Definition at line 96 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
void m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::setUnsubscriptionListener ( const boost::function< void(const typename NetworkType::Key)> &  listener)
inlinevirtual

Member Data Documentation

template<class NetworkType , unsigned int ChildAmount>
PubSubSystemEnvironment* m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::_pssi

Definition at line 74 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const long m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::periodic_

Definition at line 69 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::periodicSubscribtion
static

Definition at line 66 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const long m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::purge_distance_

Definition at line 72 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
unsigned int m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::purgeID_

Definition at line 80 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::register_deliver_subscribe
static

Definition at line 56 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::register_deliver_unsubscribe
static

Definition at line 62 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::register_forward_subscribe
static

Definition at line 53 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
const bool m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::register_forward_unsubscribe
static

Definition at line 59 of file HierarchicalSpreaditRouting.h.

template<class NetworkType , unsigned int ChildAmount>
boost::function<void(const typename NetworkType::Key)> m2etis::pubsub::routing::HierarchicalSpreaditRouting< NetworkType, ChildAmount >::removed_subscriber_eventlistener_

Definition at line 78 of file HierarchicalSpreaditRouting.h.


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