NLNET::IModuleProxy Class Reference

This interface is implemented by the system and it give convenient access to distant module information like module name or id, it also provide a helper to send module message without knowing the gateway. More...

#include <module.h>

Inherits NLMISC::CRefCount.

Inherited by NLNET::CModuleProxy.

List of all members.

Public Member Functions

virtual ~IModuleProxy ()
virtual TModuleId getModuleProxyId () const =0
 Return the module ID.
virtual TModuleId getForeignModuleId () const =0
 Return the foreign id of the proxy.
virtual uint32 getModuleDistance () const =0
 Return the distance of this module in number of gateway to cross.
virtual IModulegetLocalModule () const =0
 Return the IModule instance pointer.
virtual CGatewayRoutegetGatewayRoute () const =0
 Return a pointer to the route used to communicate with the module.
virtual const std::string & getModuleName () const =0
 Return the module name.
virtual const std::string & getModuleClassName () const =0
 Return the module class.
virtual const std::string & getModuleManifest () const =0
 Return the manifest of the module.
virtual IModuleGatewaygetModuleGateway () const =0
 Return the gateways interface by witch this module is accessible In some case, more than one gateway can be returned when there is multiple route to the same module.
virtual void sendModuleMessage (IModule *senderModule, const NLNET::CMessage &message)=0 throw (EModuleNotReachable)
 Send a message to the module.
virtual const TSecurityDatagetFirstSecurityData () const =0
 Return the first item of the security item list If no security data are available, the method return NULL.
virtual const TSecurityDatafindSecurityData (uint8 dataTag) const =0
 Look in the security data list for a block matching the specified tag.

Detailed Description

This interface is implemented by the system and it give convenient access to distant module information like module name or id, it also provide a helper to send module message without knowing the gateway.

Note that even collocated module (i.e. module created in the same process) must be accessed by module proxy or message send by through the socket interface.

Definition at line 379 of file module.h.


Constructor & Destructor Documentation

virtual NLNET::IModuleProxy::~IModuleProxy (  )  [inline, virtual]

Definition at line 382 of file module.h.


Member Function Documentation

virtual const TSecurityData* NLNET::IModuleProxy::findSecurityData ( uint8  dataTag  )  const [pure virtual]

Look in the security data list for a block matching the specified tag.

The first block having the tag is returned. If no block have the requested tag, NULL is returned.

Implemented in NLNET::CModuleProxy.

virtual const TSecurityData* NLNET::IModuleProxy::getFirstSecurityData (  )  const [pure virtual]

Return the first item of the security item list If no security data are available, the method return NULL.

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CStandardGateway::sendPendingModuleUpdate(), and NLNET::TModuleDescCodec::TModuleDescCodec().

virtual TModuleId NLNET::IModuleProxy::getForeignModuleId (  )  const [pure virtual]

Return the foreign id of the proxy.

This is the proxy id of this module in the context at the outbound of the route. Note that if the module distance id 0, then this id is the module id and if the distance is 1, then this is the id of the local proxy for the module in his host process.

Maybe you don't exactly understand the meaning of this id, what is sure is that you should never use it !

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CStandardGateway::dispatchModuleMessage(), NLNET::CModuleManager::NLMISC_CLASS_COMMAND_DECL(), NLNET::CStandardGateway::onModulePlugged(), NLNET::CStandardGateway::onModuleUnplugged(), NLNET::CStandardGateway::onRemoveModuleProxy(), and NLNET::CStandardGateway::sendModuleMessage().

virtual CGatewayRoute* NLNET::IModuleProxy::getGatewayRoute (  )  const [pure virtual]
virtual IModule* NLNET::IModuleProxy::getLocalModule (  )  const [pure virtual]

Return the IModule instance pointer.

For local module proxies, this allow quick access to the real module instance. For foreign module proxies, this always return NULL. You should never access this methods if getModuleDistance() returned more than 0 (witch mean that the module is local).

Implemented in NLNET::CModuleProxy.

virtual const std::string& NLNET::IModuleProxy::getModuleClassName (  )  const [pure virtual]

Return the module class.

For module proxy, this is always the fully qualified module name

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CModuleManager::NLMISC_CLASS_COMMAND_DECL(), NLNET::TModuleClassPred::operator()(), and NLNET::TModuleDescCodec::TModuleDescCodec().

virtual uint32 NLNET::IModuleProxy::getModuleDistance (  )  const [pure virtual]

Return the distance of this module in number of gateway to cross.

Note that when a module is reachable via more than one route, the gateway always use the shortest path to communicate with the module.

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CStandardGateway::onReceiveModuleAdd(), NLNET::CStandardGateway::sendPendingModuleUpdate(), and NLNET::TModuleDescCodec::TModuleDescCodec().

virtual IModuleGateway* NLNET::IModuleProxy::getModuleGateway (  )  const [pure virtual]

Return the gateways interface by witch this module is accessible In some case, more than one gateway can be returned when there is multiple route to the same module.

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CStandardGateway::removeSecurityData(), NLNET::CStandardGateway::replaceAllSecurityDatas(), and NLNET::CStandardGateway::setSecurityData().

virtual const std::string& NLNET::IModuleProxy::getModuleManifest (  )  const [pure virtual]

Return the manifest of the module.

The manifest is a simple string of undefined format. The manifest is used by a module to expose some intention or affinity (or whaterver else yuou could imagine) of the module.

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::TModuleDescCodec::TModuleDescCodec().

virtual const std::string& NLNET::IModuleProxy::getModuleName (  )  const [pure virtual]

Return the module name.

Each module instance must have a unique name in the host process. If no mane is given during module creation, the module manager build a unique name from the module class and a number. Distant module name are always the FQMN, ie, it is the same as getModuleFullyQualifiedName()

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CModuleBase::_onProcessModuleMessage(), NLNET::CStandardGateway::dispatchModuleMessage(), NLNET::CGatewayL5Transport::dump(), NLNET::CGatewayL3ClientTransport::dump(), NLNET::CGatewayL3ServerTransport::dump(), NLNET::CModuleManager::NLMISC_CLASS_COMMAND_DECL(), NLNET::CLocalGateway::onModulePlugged(), NLNET::CStandardGateway::sendModuleMessage(), and NLNET::TModuleDescCodec::TModuleDescCodec().

virtual TModuleId NLNET::IModuleProxy::getModuleProxyId (  )  const [pure virtual]

Return the module ID.

Each module has a local unique ID assigned by the manager during module creation. This ID is local because it is only valid inside a given process. When module are declared in another process, they receive a local ID that is different than the ID in their host process.

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CStandardGateway::discloseModuleToRoute(), NLNET::CStandardGateway::isModuleProxyVisible(), NLNET::CModuleManager::NLMISC_CLASS_COMMAND_DECL(), NLNET::CStandardGateway::onReceiveModuleAdd(), NLNET::CStandardGateway::sendModuleMessage(), NLNET::CStandardGateway::setTransportFirewallMode(), NLNET::TModuleDescCodec::TModuleDescCodec(), NLNET::CStandardGateway::undiscloseModuleToRoute(), NLNET::CStandardGateway::updateModuleDistanceToRoute(), and NLNET::CStandardGateway::updateModuleSecurityDataToRoute().

virtual void NLNET::IModuleProxy::sendModuleMessage ( IModule senderModule,
const NLNET::CMessage message 
) throw (EModuleNotReachable) [pure virtual]

Send a message to the module.

This method do the job of finding a valid socket to effectively send the message.

Implemented in NLNET::CModuleProxy.

Referenced by NLNET::CStandardGateway::_broadcastModuleMessage(), NLNET::CModuleBase::_onProcessModuleMessage(), NLNET::CStandardGateway::dispatchModuleMessage(), and NLNET::TBroadcastModuleMessage< PtrContainer >::sendMessage().


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

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