channel::Connector< Channel, Transport > Class Template Reference

#include <Connector.h>

Inheritance diagram for channel::Connector< Channel, Transport >:

channel::MarshalerRegistry< Channel::IdType, Channel::IdTrait > channel::BinderRegistry< Channel::IdType, Channel::IdTrait > List of all members.

Public Types

typedef ConnHandler< Channel,
Transport > 
ConnHandler
typedef Interface< ChannelInterface
typedef RemoteInterface< Channel,
ConnHandler
RemoteInterface
typedef Binder< typename Channel::IdType,
typename Channel::IdTrait
Binder
typedef Filter< typename Channel::IdType,
typename Channel::IdTrait
Filter
typedef Translator< typename
Channel::IdType, typename
Channel::IdTrait
Translator

Public Member Functions

 Connector (Channel *mchan, bool dt=false, int nt=1)
 ~Connector ()
Status open (std::string addr)
 open connector, start listening at address
Status open (void)
 open connector, start listening at address
Status startup (void)
Status shutdown (void)
Status close (void)
 connector close, all interanl threads exit
Status connect (std::string addr_str, Binder *b=NULL)
Status connect (ConnInfo addr, Binder *bind=NULL)
Status disconnect (std::string addr)
 disconnect from remote channel at addr
Status add_conn (ConnInfo peer_addr, ConnHandler *ch)
Status del_conn (ConnHandler *ch)
Status del_conn (ConnInfo addr)
bool is_connected (ConnInfo addr)

Static Public Member Functions

static Interface_Type type (void)
 type of transport
static void * run_event_loop (void *arg)

Public Attributes

bool exit_start_
ACE_Thread_Semaphore exit_sema_
 conn threads start exiting
Channelch_

Protected Attributes

OutputMgr< Channel, ConnHandleroutput_mgr_
 output thread-pool
int num_thr_
bool driver_thread_
std::map< ConnInfo, ConnHandler * > conn_map_
ACE_Thread_Mutex conn_map_lock_

Friends

class ConnHandler
class RemoteInterface

Detailed Description

template<class Channel, class Transport>
class channel::Connector< Channel, Transport >

Connector integrates various aspects for remote channel connection: Channel Type, Transport, OutputMgr(threads) ConnHandler(threads), RemoteInterface, Binder and Msg Marshaler

Definition at line 84 of file Connector.h.


Member Typedef Documentation

template<class Channel, class Transport>
typedef Binder<typename Channel::IdType, typename Channel::IdTrait> channel::Connector< Channel, Transport >::Binder
 

Reimplemented from channel::BinderRegistry< Channel::IdType, Channel::IdTrait >.

Definition at line 95 of file Connector.h.

template<class Channel, class Transport>
typedef ConnHandler<Channel, Transport> channel::Connector< Channel, Transport >::ConnHandler
 

Definition at line 92 of file Connector.h.

template<class Channel, class Transport>
typedef Filter<typename Channel::IdType, typename Channel::IdTrait> channel::Connector< Channel, Transport >::Filter
 

Definition at line 96 of file Connector.h.

template<class Channel, class Transport>
typedef Interface<Channel> channel::Connector< Channel, Transport >::Interface
 

Definition at line 93 of file Connector.h.

template<class Channel, class Transport>
typedef RemoteInterface<Channel, ConnHandler> channel::Connector< Channel, Transport >::RemoteInterface
 

Definition at line 94 of file Connector.h.

template<class Channel, class Transport>
typedef Translator<typename Channel::IdType, typename Channel::IdTrait> channel::Connector< Channel, Transport >::Translator
 

Definition at line 97 of file Connector.h.


Constructor & Destructor Documentation

template<class Channel, class Transport>
channel::Connector< Channel, Transport >::Connector Channel mchan,
bool  dt = false,
int  nt = 1
[inline]
 

Definition at line 117 of file Connector.h.

template<class Channel, class Transport>
channel::Connector< Channel, Transport >::~Connector  )  [inline]
 

Definition at line 124 of file Connector.h.


Member Function Documentation

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::add_conn ConnInfo  peer_addr,
ConnHandler ch
[inline]
 

The following are methods for managing conn_map

duplicated conn, should be dropped

conn_map_[peer_addr]->dump();

Definition at line 236 of file Connector.h.

Referenced by channel::ConnHandler< Channel, TcpSockTransport< Channel > >::set_up().

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::close void   )  [inline]
 

connector close, all interanl threads exit

gracely shutdown

wait for read thread to exit

Definition at line 179 of file Connector.h.

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::connect ConnInfo  addr,
Binder bind = NULL
[inline]
 

connect to remote channel addr: remote channel address Binder: the filter and translator specified at local interface

Definition at line 212 of file Connector.h.

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::connect std::string  addr_str,
Binder b = NULL
[inline]
 

connect to remote channel addr_str: remote channel address Binder: the filter and translator specified at local interface

Definition at line 203 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::connect(), and cvm::cvm::CvmBaseConnector< Chan > >::init().

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::del_conn ConnInfo  addr  )  [inline]
 

Definition at line 259 of file Connector.h.

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::del_conn ConnHandler ch  )  [inline]
 

Definition at line 248 of file Connector.h.

Referenced by channel::ConnHandler< Channel, TcpSockTransport< Channel > >::service().

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::disconnect std::string  addr  )  [inline]
 

disconnect from remote channel at addr

Definition at line 229 of file Connector.h.

template<class Channel, class Transport>
bool channel::Connector< Channel, Transport >::is_connected ConnInfo  addr  )  [inline]
 

Definition at line 265 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::connect().

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::open void   )  [inline]
 

open connector, start listening at address

Definition at line 155 of file Connector.h.

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::open std::string  addr  )  [inline]
 

open connector, start listening at address

Definition at line 141 of file Connector.h.

Referenced by cvm::cvm::CvmBaseConnector< Chan > >::init().

template<class Channel, class Transport>
static void* channel::Connector< Channel, Transport >::run_event_loop void *  arg  )  [inline, static]
 

Definition at line 131 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::startup().

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::shutdown void   )  [inline]
 

Definition at line 170 of file Connector.h.

template<class Channel, class Transport>
Status channel::Connector< Channel, Transport >::startup void   )  [inline]
 

Definition at line 165 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::open().

template<class Channel, class Transport>
static Interface_Type channel::Connector< Channel, Transport >::type void   )  [inline, static]
 

type of transport

Definition at line 127 of file Connector.h.

Referenced by cvm::cvm::CvmBaseConnector< Chan > >::init().


Friends And Related Function Documentation

template<class Channel, class Transport>
friend class ConnHandler [friend]
 

Definition at line 87 of file Connector.h.

template<class Channel, class Transport>
friend class RemoteInterface [friend]
 

Definition at line 88 of file Connector.h.


Member Data Documentation

template<class Channel, class Transport>
Channel* channel::Connector< Channel, Transport >::ch_
 

Definition at line 115 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::Connector(), and channel::ConnHandler< Channel, TcpSockTransport< Channel > >::set_up().

template<class Channel, class Transport>
std::map<ConnInfo, ConnHandler *> channel::Connector< Channel, Transport >::conn_map_ [protected]
 

current active connections indexed by remote listening addresses, which is fixed for rmt systems

Definition at line 110 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::add_conn(), channel::Connector< Channel, TcpSockTransport< Channel > >::close(), and channel::Connector< Channel, TcpSockTransport< Channel > >::Connector().

template<class Channel, class Transport>
ACE_Thread_Mutex channel::Connector< Channel, Transport >::conn_map_lock_ [protected]
 

Definition at line 111 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::add_conn(), and channel::Connector< Channel, TcpSockTransport< Channel > >::close().

template<class Channel, class Transport>
bool channel::Connector< Channel, Transport >::driver_thread_ [protected]
 

Definition at line 107 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::Connector(), and channel::Connector< Channel, TcpSockTransport< Channel > >::open().

template<class Channel, class Transport>
ACE_Thread_Semaphore channel::Connector< Channel, Transport >::exit_sema_
 

conn threads start exiting

Definition at line 100 of file Connector.h.

Referenced by channel::Unix_ConnHandler< Channel >::close(), channel::Tcp_ConnHandler< Channel >::close(), and channel::Connector< Channel, TcpSockTransport< Channel > >::close().

template<class Channel, class Transport>
bool channel::Connector< Channel, Transport >::exit_start_
 

Definition at line 99 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::close(), channel::Connector< Channel, TcpSockTransport< Channel > >::Connector(), and channel::ConnHandler< Channel, TcpSockTransport< Channel > >::service().

template<class Channel, class Transport>
int channel::Connector< Channel, Transport >::num_thr_ [protected]
 

Definition at line 106 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::Connector(), and channel::Connector< Channel, TcpSockTransport< Channel > >::open().

template<class Channel, class Transport>
OutputMgr<Channel, ConnHandler> channel::Connector< Channel, Transport >::output_mgr_ [protected]
 

output thread-pool

Definition at line 105 of file Connector.h.

Referenced by channel::Connector< Channel, TcpSockTransport< Channel > >::close(), and channel::Connector< Channel, TcpSockTransport< Channel > >::open().


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