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

#include <MapRouter.h>

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

channel::RouterBase List of all members.

Public Types

typedef Channel< IdType, IdTrait,
SynchPolicy, MapRouter< 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
enum  { NamespaceType = NAMESPACE_LINEAR }

Public Member Functions

 MapRouter ()
 ~MapRouter ()
Status publish_msg (IdType t, PubSub_Scope s, 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 msg_sub_tbl
Status published_global_msgs (std::vector< IdType > &global_msgs)
void dump_routing_tables (void)

Protected Member Functions

Status propagate_change_to_neighbors (Oper_Type op, IdType t)

Private Attributes

std::map< IdType, PubSub_Registry * > msg_sub_tbl_
SynchPolicy::RW_MUTEX msg_sub_tbl_lock_
std::map< IdType, std::list<
Source * > * > 
msg_pub_tbl_
SynchPolicy::RW_MUTEX msg_pub_tbl_lock_

Classes

struct  PubSub_Registry

Detailed Description

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

MapRouter: using stl map as routing table using id matching

Definition at line 43 of file MapRouter.h.


Member Typedef Documentation

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

Definition at line 47 of file MapRouter.h.

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

Definition at line 48 of file MapRouter.h.

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

Definition at line 52 of file MapRouter.h.

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

Definition at line 53 of file MapRouter.h.

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

Definition at line 49 of file MapRouter.h.


Member Enumeration Documentation

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

Enumerator:
NamespaceType 

Definition at line 45 of file MapRouter.h.


Constructor & Destructor Documentation

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

Definition at line 81 of file MapRouter.h.

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

Definition at line 84 of file MapRouter.h.

References channel::MapRouter< IdType, IdTrait, SynchPolicy >::msg_sub_tbl_, and channel::MapRouter< IdType, IdTrait, SynchPolicy >::msg_sub_tbl_lock_.


Member Function Documentation

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

Definition at line 335 of file MapRouter.h.

References ID2STR.

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

4. propagate namespace changes to connected channels

Definition at line 369 of file MapRouter.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>
Status channel::MapRouter< IdType, IdTrait, SynchPolicy >::publish_msg IdType  t,
PubSub_Scope  s,
Source src
[inline]
 

publish

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

Definition at line 108 of file MapRouter.h.

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

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

Definition at line 323 of file MapRouter.h.

References channel::FAILURE.

template<class IdType, class IdTrait, class SynchPolicy>
Status channel::MapRouter< 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

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

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

Definition at line 236 of file MapRouter.h.

References channel::FAILURE, ID2STR, channel::SCOPE_NUMBER, channel::MapRouter< IdType, IdTrait, SynchPolicy >::PubSub_Registry::subers_, channel::MapRouter< IdType, IdTrait, SynchPolicy >::PubSub_Registry::subers_lock_, and channel::Msg< IdType, SynchPolicy >::type.

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

subscribe

Definition at line 156 of file MapRouter.h.

References channel::FAILURE, ID2STR, channel::MEMBER_LOCAL, channel::OPER_SUBSCRIBE, channel::SCOPE_GLOBAL, channel::SCOPE_REMOTE, channel::MapRouter< IdType, IdTrait, SynchPolicy >::PubSub_Registry::subers_, channel::MapRouter< IdType, IdTrait, SynchPolicy >::PubSub_Registry::subers_lock_, and channel::SUCCESS.

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

exported msg_sub_tbl

3. query msg_sub_tbl content

Definition at line 295 of file MapRouter.h.

References channel::FAILURE, channel::MEMBER_LOCAL, channel::SCOPE_GLOBAL, and channel::SCOPE_REMOTE.

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

unpublish

Definition at line 132 of file MapRouter.h.

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

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

unsubscribe

Definition at line 194 of file MapRouter.h.

References channel::FAILURE, ID2STR, channel::MEMBER_LOCAL, channel::SCOPE_GLOBAL, channel::SCOPE_REMOTE, channel::MapRouter< IdType, IdTrait, SynchPolicy >::PubSub_Registry::subers_, channel::MapRouter< IdType, IdTrait, SynchPolicy >::PubSub_Registry::subers_lock_, and channel::SUCCESS.


Member Data Documentation

template<class IdType, class IdTrait, class SynchPolicy>
std::map<IdType, std::list<Source *>*> channel::MapRouter< IdType, IdTrait, SynchPolicy >::msg_pub_tbl_ [private]
 

Definition at line 76 of file MapRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
SynchPolicy::RW_MUTEX channel::MapRouter< IdType, IdTrait, SynchPolicy >::msg_pub_tbl_lock_ [private]
 

Definition at line 77 of file MapRouter.h.

template<class IdType, class IdTrait, class SynchPolicy>
std::map<IdType, PubSub_Registry*> channel::MapRouter< IdType, IdTrait, SynchPolicy >::msg_sub_tbl_ [private]
 

Definition at line 72 of file MapRouter.h.

Referenced by channel::MapRouter< IdType, IdTrait, SynchPolicy >::~MapRouter().

template<class IdType, class IdTrait, class SynchPolicy>
SynchPolicy::RW_MUTEX channel::MapRouter< IdType, IdTrait, SynchPolicy >::msg_sub_tbl_lock_ [private]
 

Definition at line 73 of file MapRouter.h.

Referenced by channel::MapRouter< IdType, IdTrait, SynchPolicy >::~MapRouter().


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