NLNET::CGatewayL5Transport Class Reference

Gateway transport using layer 5. More...

Inherits NLNET::IGatewayTransport.

List of all members.

Public Types

typedef std::map< TServiceId,
CL5Route * > 
TRouteMap
typedef std::map
< TL5TransportId,
CGatewayL5Transport * > 
TTransportDispatcher

Public Member Functions

 CGatewayL5Transport (const IGatewayTransport::TCtorParam &param)
 Constructor.
 ~CGatewayL5Transport ()
const std::string & getClassName () const
 Return the class name from the transport factory.
virtual void update ()
 The gateway update the transport regularly.
virtual uint32 getRouteCount () const
 Return the number of route currently open by the transport.
void dump (NLMISC::CLog &log) const
 Dump debug information in the specified log stream.
void onCommand (const CMessage &) throw (EInvalidCommand)
 The gateway send a command message to the transport.
bool onCommand (const TParsedCommandLine &command) throw (EInvalidCommand)
 The gateway send a textual command to the transport.
void open (const std::string &subNetName) throw (ETransportError)
 Open the server by establishing route with all known services.
void close ()
 Close the server, this will close all route.
void onServiceUp (const std::string &serviceName, TServiceId sid)
 Event management.
void onServiceDown (const std::string &, TServiceId sid)
void onDispatchMessage (const CMessage &msgin, TServiceId sid)
void onAddTransport (TServiceId sid, TTransportDesc &desc)
void onRemoveTransport (TServiceId sid, TTransportDesc &desc)

Static Public Member Functions

static void cbL5AddTransport (CMessage &msgin, const std::string &, TServiceId sid)
 static callback forwarder
static void cbL5RemoveTransport (CMessage &msgin, const std::string &, TServiceId sid)
static void cbDispatchL5Message (CMessage &msgin, const std::string &serviceName, TServiceId sid)
static void cbOnServiceUp (const std::string &serviceName, TServiceId sid, void *)
static void cbOnServiceDown (const std::string &serviceName, TServiceId sid, void *)

Public Attributes

TL5TransportId _TransportId
 This transport ID.
bool _Open
 current open status
string _SubNetName
 Subnet name.
TRouteMap _Routes
 The table that keep track of all routes.

Static Public Attributes

static TTransportDispatcher _TransportDispatcher
 Global index of transport use to dispatch received message.

Friends

class CL5Route

Detailed Description

Gateway transport using layer 5.

Definition at line 125 of file module_l5_transport.cpp.


Member Typedef Documentation

Definition at line 137 of file module_l5_transport.cpp.

Definition at line 141 of file module_l5_transport.cpp.


Constructor & Destructor Documentation

NLNET::CGatewayL5Transport::CGatewayL5Transport ( const IGatewayTransport::TCtorParam param  )  [inline]

Constructor.

Definition at line 146 of file module_l5_transport.cpp.

References _TransportDispatcher, _TransportId, and NLNET::IGatewayTransport::PeerInvisible.

NLNET::CGatewayL5Transport::~CGatewayL5Transport (  )  [inline]

Definition at line 160 of file module_l5_transport.cpp.

References _Open, _TransportDispatcher, _TransportId, close(), and nlassert.


Member Function Documentation

static void NLNET::CGatewayL5Transport::cbDispatchL5Message ( CMessage msgin,
const std::string &  serviceName,
TServiceId  sid 
) [inline, static]
static void NLNET::CGatewayL5Transport::cbL5AddTransport ( CMessage msgin,
const std::string &  ,
TServiceId  sid 
) [inline, static]
static void NLNET::CGatewayL5Transport::cbL5RemoveTransport ( CMessage msgin,
const std::string &  ,
TServiceId  sid 
) [inline, static]
static void NLNET::CGatewayL5Transport::cbOnServiceDown ( const std::string &  serviceName,
TServiceId  sid,
void *   
) [inline, static]

Definition at line 578 of file module_l5_transport.cpp.

References _Open, _TransportDispatcher, LNETL6_DEBUG, and onServiceDown().

Referenced by open().

static void NLNET::CGatewayL5Transport::cbOnServiceUp ( const std::string &  serviceName,
TServiceId  sid,
void *   
) [inline, static]

Definition at line 564 of file module_l5_transport.cpp.

References _Open, _TransportDispatcher, LNETL6_DEBUG, and onServiceUp().

Referenced by open().

void NLNET::CGatewayL5Transport::close (  )  [inline]

Close the server, this will close all route.

Definition at line 325 of file module_l5_transport.cpp.

References _Open, _Routes, H_AUTO, onServiceDown(), and NLNET::CL5Route::ServiceId.

Referenced by onCommand(), and ~CGatewayL5Transport().

void NLNET::CGatewayL5Transport::dump ( NLMISC::CLog log  )  const [inline, virtual]
const std::string& NLNET::CGatewayL5Transport::getClassName (  )  const [inline, virtual]

Return the class name from the transport factory.

Implements NLNET::IGatewayTransport.

Definition at line 175 of file module_l5_transport.cpp.

References LAYER5_CLASS_NAME.

virtual uint32 NLNET::CGatewayL5Transport::getRouteCount (  )  const [inline, virtual]

Return the number of route currently open by the transport.

Implements NLNET::IGatewayTransport.

Definition at line 185 of file module_l5_transport.cpp.

References _Routes.

void NLNET::CGatewayL5Transport::onAddTransport ( TServiceId  sid,
TTransportDesc desc 
) [inline]
bool NLNET::CGatewayL5Transport::onCommand ( const TParsedCommandLine command  )  throw (EInvalidCommand) [inline, virtual]

The gateway send a textual command to the transport.

look for an optional sub network name

Implements NLNET::IGatewayTransport.

Definition at line 234 of file module_l5_transport.cpp.

References close(), open(), and NLNET::TParsedCommandLine::ParamValue.

void NLNET::CGatewayL5Transport::onCommand ( const CMessage command  )  throw (EInvalidCommand) [inline, virtual]

The gateway send a command message to the transport.

Implements NLNET::IGatewayTransport.

Definition at line 228 of file module_l5_transport.cpp.

void NLNET::CGatewayL5Transport::onDispatchMessage ( const CMessage msgin,
TServiceId  sid 
) [inline]
void NLNET::CGatewayL5Transport::onRemoveTransport ( TServiceId  sid,
TTransportDesc desc 
) [inline]
void NLNET::CGatewayL5Transport::onServiceDown ( const std::string &  ,
TServiceId  sid 
) [inline]
void NLNET::CGatewayL5Transport::onServiceUp ( const std::string &  serviceName,
TServiceId  sid 
) [inline]

Event management.

Definition at line 348 of file module_l5_transport.cpp.

References _SubNetName, _TransportId, H_AUTO, LNETL6_DEBUG, NLNET::msg, and NLMISC::CMemStream::serial().

Referenced by cbOnServiceUp(), and open().

void NLNET::CGatewayL5Transport::open ( const std::string &  subNetName  )  throw (ETransportError) [inline]
virtual void NLNET::CGatewayL5Transport::update (  )  [inline, virtual]

The gateway update the transport regularly.

Implements NLNET::IGatewayTransport.

Definition at line 181 of file module_l5_transport.cpp.


Friends And Related Function Documentation

friend class CL5Route [friend]

Definition at line 127 of file module_l5_transport.cpp.

Referenced by onAddTransport().


Member Data Documentation

The table that keep track of all routes.

Definition at line 139 of file module_l5_transport.cpp.

Referenced by close(), dump(), getRouteCount(), onAddTransport(), onDispatchMessage(), onRemoveTransport(), and onServiceDown().

Subnet name.

Definition at line 135 of file module_l5_transport.cpp.

Referenced by cbL5AddTransport(), cbL5RemoveTransport(), onAddTransport(), onServiceUp(), and open().

Global index of transport use to dispatch received message.

Definition at line 143 of file module_l5_transport.cpp.

Referenced by cbDispatchL5Message(), cbL5AddTransport(), cbL5RemoveTransport(), cbOnServiceDown(), cbOnServiceUp(), CGatewayL5Transport(), and ~CGatewayL5Transport().


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

Generated on Thu Jan 7 08:30:21 2010 for NeL by  doxygen 1.6.1