m2etis  0.4
m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType > Class Template Reference

creates connections between every single node and sends messages directly, so every node is a root node for its connections doesn't work with GMSOrder because it doesn't use publish messages but notifies directly More...

#include <DirectBroadcastRouting.h>

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

Public Types

typedef message::DirectBroadcastRoutingInfo< NetworkType > RoutingInfoType
 
typedef std::vector< typename NetworkType::Key > KeyList
 
typedef std::set< typename NetworkType::Key > KeySet
 
typedef std::pair< uint64_t, typename NetworkType::Key > TimePair
 
typedef std::vector< TimePairTimeList
 

Public Member Functions

 DirectBroadcastRouting (const unsigned short topic_name, PubSubSystemEnvironment *pssi, const typename NetworkType::Key &root)
 
virtual ~DirectBroadcastRouting ()
 
void registerOnRoot ()
 
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 &) const
 
bool processSubscribePayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &, message::ActionType &) override
 
void processUnsubscribePayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &sender, typename NetworkType::Key &, message::ActionType &)
 
void processPublishPayload (typename message::RoutingInfo< NetworkType >::Ptr routingInfo, const typename NetworkType::Key &, typename NetworkType::Key &, message::ActionType &)
 
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 &, 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_subscribereventlistener
 
uint64_t purgeID_
 
uint64_t registerID_
 

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>
class m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >

creates connections between every single node and sends messages directly, so every node is a root node for its connections doesn't work with GMSOrder because it doesn't use publish messages but notifies directly

Definition at line 43 of file DirectBroadcastRouting.h.

Member Typedef Documentation

template<class NetworkType >
typedef std::vector<typename NetworkType::Key> m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::KeyList

Definition at line 46 of file DirectBroadcastRouting.h.

template<class NetworkType >
typedef std::set<typename NetworkType::Key> m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::KeySet

Definition at line 47 of file DirectBroadcastRouting.h.

template<class NetworkType >
typedef message::DirectBroadcastRoutingInfo<NetworkType> m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::RoutingInfoType

Definition at line 45 of file DirectBroadcastRouting.h.

template<class NetworkType >
typedef std::vector<TimePair> m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::TimeList

Definition at line 49 of file DirectBroadcastRouting.h.

template<class NetworkType >
typedef std::pair<uint64_t, typename NetworkType::Key> m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::TimePair

Definition at line 48 of file DirectBroadcastRouting.h.

Constructor & Destructor Documentation

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

Definition at line 86 of file DirectBroadcastRouting.h.

Here is the call graph for this function:

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

Definition at line 94 of file DirectBroadcastRouting.h.

Here is the call graph for this function:

Member Function Documentation

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::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 139 of file DirectBroadcastRouting.h.

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

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

Parameters
mtypethe type of the message (SUBSCRIBE, UNSUBSCIBE, or PUBLISH)
algoinfoonly contains info if mytpe == PUBLISH

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

Definition at line 175 of file DirectBroadcastRouting.h.

Here is the call graph for this function:

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::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 314 of file DirectBroadcastRouting.h.

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::processNotifyPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  ,
typename NetworkType::Key &  ,
message::ActionType  
)
inlinevirtual

Handle a notify message

Parameters
senderthe notifier's key
algoinfothe payload created by this algorithm at the notify's node
Returns
an information unit, whether the message should be spread out to subscribers ond if the current node is the root-node for that topic.

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

Definition at line 309 of file DirectBroadcastRouting.h.

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::processPublishPayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  ,
typename NetworkType::Key &  ,
message::ActionType  
)
inlinevirtual

Handle a publish message

Parameters
senderthe publisher's key
algoinfothe payload created by this algorithm at the publisher's node
Returns
an information unit, whether the message should be spread out to subscribers ond if the current node is the root-node for that topic.

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

Definition at line 297 of file DirectBroadcastRouting.h.

template<class NetworkType >
bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::processSubscribePayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  ,
message::ActionType  
)
inlineoverridevirtual

Handle a subscribe message

Parameters
senderthe subscriber's key
algoinfothe payload created by this algorithm at the subscriber's node
Returns
an information unit, whether the message should be stopped or needs to be changed

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

Definition at line 249 of file DirectBroadcastRouting.h.

Here is the call graph for this function:

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::processUnsubscribePayload ( typename message::RoutingInfo< NetworkType >::Ptr  routingInfo,
const typename NetworkType::Key &  sender,
typename NetworkType::Key &  ,
message::ActionType  
)
inlinevirtual

Handle a unsubscribe message

Parameters
senderthe unsubscriber's key
algoinfothe payload created by this algorithm at the unsubscriber's node
Returns
an information unit, whether the message should be stopped or needs to be changed

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

Definition at line 277 of file DirectBroadcastRouting.h.

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::registerOnRoot ( )
inline

Definition at line 100 of file DirectBroadcastRouting.h.

Here is the caller graph for this function:

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::selfSubscribed ( const bool  b)
inline

Definition at line 130 of file DirectBroadcastRouting.h.

template<class NetworkType >
bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::selfSubscribed ( ) const
inline

Definition at line 135 of file DirectBroadcastRouting.h.

Here is the caller graph for this function:

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::setSelf ( const typename NetworkType::Key &  self)
inline

Definition at line 118 of file DirectBroadcastRouting.h.

template<class NetworkType >
void m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::setUnsubscriptionListener ( const boost::function< void(const typename NetworkType::Key)> &  listener)
inlinevirtual

Member Data Documentation

template<class NetworkType >
PubSubSystemEnvironment* m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::_pssi

Definition at line 76 of file DirectBroadcastRouting.h.

template<class NetworkType >
boost::function<void(const typename NetworkType::Key)> m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::_removed_subscribereventlistener

Definition at line 80 of file DirectBroadcastRouting.h.

template<class NetworkType >
const uint64_t m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::periodic_

Definition at line 71 of file DirectBroadcastRouting.h.

template<class NetworkType >
const bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::periodicSubscribtion
static

Definition at line 68 of file DirectBroadcastRouting.h.

template<class NetworkType >
const uint64_t m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::purge_distance_

Definition at line 74 of file DirectBroadcastRouting.h.

template<class NetworkType >
uint64_t m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::purgeID_

Definition at line 82 of file DirectBroadcastRouting.h.

template<class NetworkType >
const bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::register_deliver_subscribe
static

Definition at line 58 of file DirectBroadcastRouting.h.

template<class NetworkType >
const bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::register_deliver_unsubscribe
static

Definition at line 64 of file DirectBroadcastRouting.h.

template<class NetworkType >
const bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::register_forward_subscribe
static

Definition at line 55 of file DirectBroadcastRouting.h.

template<class NetworkType >
const bool m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::register_forward_unsubscribe
static

Definition at line 61 of file DirectBroadcastRouting.h.

template<class NetworkType >
uint64_t m2etis::pubsub::routing::DirectBroadcastRouting< NetworkType >::registerID_

Definition at line 84 of file DirectBroadcastRouting.h.


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