channel::TrieRouter< IdType, IdTrait, SynchPolicy > Class Template Reference

#include <TrieRouter.h>

Inheritance diagram for channel::TrieRouter< IdType, IdTrait, SynchPolicy >:

channel::RouterBase List of all members.

Public Types

typedef Channel< IdType, IdTrait,
SynchPolicy, TrieRouter<
IdType, IdTrait, SynchPolicy > > 
Channel
typedef Destination< Channel,
NamespaceType > 
Destination
typedef Source< Channel, NamespaceType > Source
typedef Msg< IdType, SynchPolicy > Msg
typedef PubSub_Info_Msg< IdTypePubSub_Info_Msg
typedef IdTrait::NameType NameType
enum  { NamespaceType = NAMESPACE_HIERARCHICAL }

Public Member Functions

 TrieRouter ()
 ~TrieRouter ()
void propagate_child_pub_registry (IdType t, TrieNode< Pub_Registry > *node, Oper_Type oper)
void propagate_child_sub_registry (IdType t, TrieNode< Sub_Registry > *node, Oper_Type oper)
Status publish_msg (IdType t, PubSub_Scope c, Source *src)
 publish
Status unpublish_msg (IdType t, PubSub_Scope s, Source *src)
 unpublish
Status subscribe_msg (IdType t, PubSub_Scope c, Destination *dest)
 subscribe
Status unsubscribe_msg (IdType t, Destination *dest)
 unsubscribe
Status route_msg (Msg *msg, Member_Type src_type, PubSub_Scope pub_scope, ACE_Time_Value *timeout=0)
Status subscribed_global_msgs (std::vector< IdType > &global_msgs)
 exported namespace
Status subscribed_global_msgs_recursive (std::vector< IdType > &global_msgs, TrieNode< Sub_Registry > *node, IdType &id)
Status published_global_msgs (std::vector< IdType > &global_msgs)
Status published_global_msgs_recursive (std::vector< IdType > &global_msgs, TrieNode< Pub_Registry > *node, IdType &id)
void dump_pub_ids_recursive (TrieNode< Pub_Registry > *node, IdType &id)
void dump_sub_ids_recursive (TrieNode< Sub_Registry > *node, IdType &id)
void dump_routing_tables (void)

Protected Member Functions

Status propagate_change_to_neighbors (Oper_Type op, IdType t)

Private Attributes

TrieNode< Sub_Registry > * sub_trie_root_
TrieNode< Pub_Registry > * pub_trie_root_

Classes

struct  Pub_Registry
struct  Sub_Registry
struct  TrieNode

Detailed Description

template<class IdType, class IdTrait, class SynchPolicy>
class channel::TrieRouter< IdType, IdTrait, SynchPolicy >

HierarchicalRouter: using trie as routing data structure using pathname matching

Definition at line 43 of file TrieRouter.h.


Member Typedef Documentation

template<class IdType, class IdTrait, class SynchPolicy>
typedef Channel<IdType, IdTrait, SynchPolicy, TrieRouter<IdType, IdTrait, SynchPolicy> > channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Channel
 

Definition at line 47 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
typedef Destination<Channel, NamespaceType> channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Destination
 

Definition at line 48 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
typedef Msg<IdType, SynchPolicy> channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Msg
 

Definition at line 52 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
typedef IdTrait::NameType channel::TrieRouter< IdType, IdTrait, SynchPolicy >::NameType
 

Definition at line 54 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
typedef PubSub_Info_Msg<IdType> channel::TrieRouter< IdType, IdTrait, SynchPolicy >::PubSub_Info_Msg
 

Definition at line 53 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
typedef Source<Channel, NamespaceType> channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Source
 

Definition at line 49 of file TrieRouter.h.


Member Enumeration Documentation

template<class IdType, class IdTrait, class SynchPolicy>
anonymous enum
 

Enumerator:
NamespaceType 

Definition at line 45 of file TrieRouter.h.


Constructor & Destructor Documentation

template<class IdType, class IdTrait, class SynchPolicy>
channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieRouter  )  [inline]
 

Definition at line 120 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
channel::TrieRouter< IdType, IdTrait, SynchPolicy >::~TrieRouter  )  [inline]
 

Definition at line 125 of file TrieRouter.h.


Member Function Documentation

template<class IdType, class IdTrait, class SynchPolicy>
void channel::TrieRouter< IdType, IdTrait, SynchPolicy >::dump_pub_ids_recursive TrieNode< Pub_Registry > *  node,
IdType id
[inline]
 

Definition at line 795 of file TrieRouter.h.

References channel::FAILURE, ID2STR, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::pubers_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::pubers_lock_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::w_pubers_.

template<class IdType, class IdTrait, class SynchPolicy>
void channel::TrieRouter< IdType, IdTrait, SynchPolicy >::dump_routing_tables void   )  [inline]
 

Definition at line 849 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
void channel::TrieRouter< IdType, IdTrait, SynchPolicy >::dump_sub_ids_recursive TrieNode< Sub_Registry > *  node,
IdType id
[inline]
 

Definition at line 822 of file TrieRouter.h.

References channel::FAILURE, ID2STR, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_lock_, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::w_subers_.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::propagate_change_to_neighbors Oper_Type  op,
IdType  t
[inline, protected]
 

4. propagate namespace changes to connected channels

Definition at line 868 of file TrieRouter.h.

References ID2STR, channel::MEMBER_LOCAL, channel::PubSub_Info_Msg< IdType >::msg_types, channel::PubSub_Info_Msg< IdType >::num_msg_types, channel::OPER_PUBLISH, channel::OPER_SUBSCRIBE, channel::OPER_UNPUBLISH, channel::OPER_UNSUBSCRIBE, channel::SCOPE_REMOTE, and channel::SUCCESS.

template<class IdType, class IdTrait, class SynchPolicy>
void channel::TrieRouter< IdType, IdTrait, SynchPolicy >::propagate_child_pub_registry IdType  t,
TrieNode< Pub_Registry > *  node,
Oper_Type  oper
[inline]
 

Definition at line 130 of file TrieRouter.h.

References channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::pubers_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::pubers_lock_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::w_pubers_.

template<class IdType, class IdTrait, class SynchPolicy>
void channel::TrieRouter< IdType, IdTrait, SynchPolicy >::propagate_child_sub_registry IdType  t,
TrieNode< Sub_Registry > *  node,
Oper_Type  oper
[inline]
 

Definition at line 156 of file TrieRouter.h.

References channel::MEMBER_LOCAL, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, channel::SCOPE_GLOBAL, channel::SCOPE_REMOTE, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_lock_, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::w_subers_.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::publish_msg IdType  t,
PubSub_Scope  c,
Source src
[inline]
 

publish

1. Local operations on Channel/Router namespace: pub/unpub, sub/unsub

traverse to node designated by t

if t[level] = *, add src & st -> node.registry->w_pubers, if scope_state is active, deactivate children for src, return;

Definition at line 201 of file TrieRouter.h.

References channel::SCOPE_GLOBAL, channel::SCOPE_REMOTE, and channel::SUCCESS.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::published_global_msgs std::vector< IdType > &  global_msgs  )  [inline]
 

Definition at line 759 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::published_global_msgs_recursive std::vector< IdType > &  global_msgs,
TrieNode< Pub_Registry > *  node,
IdType id
[inline]
 

Definition at line 764 of file TrieRouter.h.

References channel::FAILURE, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::pubers_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::pubers_lock_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, channel::SUCCESS, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Pub_Registry::w_pubers_.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::route_msg Msg msg,
Member_Type  src_type,
PubSub_Scope  pub_scope,
ACE_Time_Value *  timeout = 0
[inline]
 

2. route msgs (from src to dest) based on : src_type(local/remote) & publish_scope AND dest_type(local/remote) & subscribe_scope

traverse to node designated by t

ACE_DEBUG ((LM_DEBUG, "before clone\n"));

ACE_DEBUG ((LM_DEBUG, "after clone\n"));

ACE_DEBUG ((LM_DEBUG, "before clone\n"));

ACE_DEBUG ((LM_DEBUG, "after clone\n"));

ACE_DEBUG ((LM_DEBUG, "before clone\n"));

ACE_DEBUG ((LM_DEBUG, "after clone\n"));

Definition at line 624 of file TrieRouter.h.

References channel::Msg< IdType, SynchPolicy >::clone(), channel::FAILURE, ID2STR, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, channel::SCOPE_NUMBER, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_lock_, channel::Msg< IdType, SynchPolicy >::type, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::w_subers_.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::subscribe_msg IdType  t,
PubSub_Scope  c,
Destination dest
[inline]
 

subscribe

traverse to node designated by t

if wildcard, add dest & st -> node.registry->w_subers, if scope_state is active, deactivate children for dest, return;

Definition at line 393 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::subscribed_global_msgs std::vector< IdType > &  global_msgs  )  [inline]
 

exported namespace

3. query namespace content

Definition at line 710 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::subscribed_global_msgs_recursive std::vector< IdType > &  global_msgs,
TrieNode< Sub_Registry > *  node,
IdType id
[inline]
 

Definition at line 715 of file TrieRouter.h.

References channel::FAILURE, channel::MEMBER_LOCAL, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::TrieNode< Registry >::registry, channel::SCOPE_GLOBAL, channel::SCOPE_REMOTE, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_, channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::subers_lock_, channel::SUCCESS, and channel::TrieRouter< IdType, IdTrait, SynchPolicy >::Sub_Registry::w_subers_.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::unpublish_msg IdType  t,
PubSub_Scope  s,
Source src
[inline]
 

unpublish

traverse to node designated by t

if t[level] = *

Definition at line 290 of file TrieRouter.h.

References channel::SCOPE_GLOBAL, channel::SCOPE_REMOTE, and channel::SUCCESS.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::TrieRouter< IdType, IdTrait, SynchPolicy >::unsubscribe_msg IdType  t,
Destination dest
[inline]
 

unsubscribe

traverse to node designated by t

if t[level] = *, add src & st -> node.registry->w_pubers, if scope_state is active, deactivate children for src, return;

Definition at line 502 of file TrieRouter.h.


Member Data Documentation

template<class IdType, class IdTrait, class SynchPolicy>
TrieNode<Pub_Registry>* channel::TrieRouter< IdType, IdTrait, SynchPolicy >::pub_trie_root_ [private]
 

Definition at line 116 of file TrieRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
TrieNode<Sub_Registry>* channel::TrieRouter< IdType, IdTrait, SynchPolicy >::sub_trie_root_ [private]
 

Definition at line 115 of file TrieRouter.h.


The documentation for this class was generated from the following file:
Generated on Mon Feb 27 19:59:24 2006 for channel by  doxygen 1.4.6-NO