MAK RTIspy API Documentation for HLA 1516
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtRtiForwarderGroup Class Reference
+ Collaboration diagram for DtRtiForwarderGroup:

List of all members.

Classes

class  DtRtiForwarderGroupMember
 Data-only helper class to store information about forwarders in the group. More...

Public Types

typedef std::map
< DtTcpMsgSocket
*, DtRtiForwarderGroupMember * > 
DtForwarderGroupConnectionList
typedef std::map
< MAKRti::DtString,
DtRtiForwarderGroupMember * > 
DtForwarderGroupMemberList
typedef DtRtiForwarderGroup *(* DtForwarderGroupCreatorFcn )(const MAKRti::DtString &, int)
 DtForwarderPort creator signature.

Public Member Functions

virtual ~DtRtiForwarderGroup ()
 Destructor.
virtual bool addForwarderToGroup (const MAKRti::DtString &fwderName, const MAKRti::DtInetAddr &addr, const MAKRti::DtString &host, int connectPort=-1, const MAKRti::DtString &url=NULL, bool isPortal=false)
 Add an unconnected forwarder to the group.
virtual unsigned int connectToPortal (const MAKRti::DtString &fwderName=NULL, bool ignorePortalFlag=false)
 Add a connection to a portal (send-and-receive) forwarder in the group.
virtual unsigned int connectToPortal (DtTcpMsgSocket *socket, bool ignorePortalFlag=false)
virtual bool connectToForwarder (const MAKRti::DtString &fwderName)
 Add a connection to a non-portal (receive-only) forwarder in the group.
virtual bool connectToForwarder (DtTcpMsgSocket *socket)
virtual bool disconnectFromForwarder (DtTcpMsgSocket *socket)
 Disconnect from the specified forwarder, but don't remove from the group.
virtual void disconnectFromGroup ()
 Disconnect from all forwarders in the group.
virtual bool removeForwarder (const MAKRti::DtString &fwderName)
 Remove (and disconnect if necessary) the specified forwarder from the group.
virtual bool removeForwarder (DtTcpMsgSocket *socket)
virtual void dissolve ()
 Remove (and disconnect from) all forwarders in the group.
virtual const
DtForwarderGroupMemberList 
members () const
 Return the map of all forwarders (keyed by name) in the group.
virtual bool isMember (const MAKRti::DtString &fwderName)
 Return true if the specified forwarder is a member of the group.
virtual bool isMember (const DtInetAddrAndPort &addr)
virtual bool isMember (DtTcpMsgSocket *sock)
virtual const
DtForwarderGroupConnectionList
portalConnections () const
 Return the map of portals (keyed by socket) (ie.
virtual const
DtForwarderGroupConnectionList
connections () const
 Return a map of all forwarders (keyed by socket) that messages may be received from (ie.
virtual void setConnectionManager (DtPeerToPeerTcpSockMgr *connMgr)
 Set the connection manager if it is not provided in the ctor.
virtual void setDefaultPort (int port)
 Change the group characteristics.
virtual void setForwarderInfo (const DtInetAddrAndPort &addr, const MAKRti::DtString &url=NULL, bool isPortal=false)
 Change the group member characteristics.
virtual void setForwarderInfo (DtTcpMsgSocket *socket, const MAKRti::DtString &url=NULL, bool isPortal=false)
MAKRti::DtString getForwarderNameByAddr (const DtInetAddrAndPort &addr) const
 Return the name of the forwarder based on its IP address.
DtInetAddrAndPort getForwarderAddrByName (const MAKRti::DtString &fwderName) const
 Return the IP address of the forwarder based on its name.
virtual bool forwarderIsAPortal (const MAKRti::DtString &fwderName) const
 Return value indicates whether the specified group member is a portal (or at least capable of being one, even if it's not being used as the portal to this group at the moment)
virtual unsigned int portalCount () const
 Return a count of portal connections to the group.
virtual unsigned int connectionCount () const
 Return a count of all connections existing to the group.
virtual unsigned int memberCount () const
 Return a count of all forwarders (connected or not) in the group.
virtual const MAKRti::DtString & groupName () const
 Return the group name.
virtual
DtRtiForwarderGroup::DtRtiForwarderGroupMember
nextAvailablePortal ()
 Get pointer to next portal available to accept connection from foreign forwarders in load-balance configurations.
virtual bool updateNextAvailablePortal ()
 Update next available portal to select next member in roster capable of acting as a portal.

Static Public Member Functions

static DtRtiForwarderGroupcreate (const MAKRti::DtString &name, int defaultPort)
 Creates an instance of a DtRtiForwarderGroup.
static void setCreatorFunction (DtForwarderGroupCreatorFcn creator)
 Call this function to set an alternate creator function With this function, users can replace this DtRtiForwarderGroup with their own derived class.

Protected Member Functions

 DtRtiForwarderGroup (const MAKRti::DtString &name, int defaultPort)
 Constructor. Use create() to instantiate a new group object.

Protected Attributes

MAKRti::DtString myName
DtPeerToPeerTcpSockMgrmyConnectionMgr
int myDefaultPort
DtForwarderGroupConnectionList myConnectionSocketMap
 Connections keyed by socket.
DtForwarderGroupMemberList myConnectionRoster
 Connections keyed by forwarder name.
DtForwarderGroupMemberList myRoster
 Group member list keyed by forwarder name.
DtForwarderGroupConnectionList myPortalForwarders
 Socket lists to simplify the task of determining where to transmit messages to (myPortalForwarders) and receive messages from (myConnectedForwarders).
DtForwarderGroupConnectionList myConnectedForwarders
DtRtiForwarderGroup::DtRtiForwarderGroupMembermyNextAvailablePortal
 Aid to keep track of which portal in group is next in line to accept connections from foreign groups in load-balanced configurations.

Static Protected Attributes

static DtForwarderGroupCreatorFcn theCreator = 0

Member Typedef Documentation

typedef DtRtiForwarderGroup*(* DtRtiForwarderGroup::DtForwarderGroupCreatorFcn)(const MAKRti::DtString &, int)

DtForwarderPort creator signature.


Constructor & Destructor Documentation

DtRtiForwarderGroup::DtRtiForwarderGroup ( const MAKRti::DtString &  name,
int  defaultPort 
) [protected]

Constructor. Use create() to instantiate a new group object.

Referenced by create().

Destructor.

References dissolve().


Member Function Documentation

bool DtRtiForwarderGroup::addForwarderToGroup ( const MAKRti::DtString &  fwderName,
const MAKRti::DtInetAddr &  addr,
const MAKRti::DtString &  host,
int  connectPort = -1,
const MAKRti::DtString &  url = NULL,
bool  isPortal = false 
) [virtual]

Add an unconnected forwarder to the group.

Returns true if new forwarder added successfully, false if duplicate forwarder name found.

References myDefaultPort, myRoster, and NULL.

Referenced by DtRouteMap::addForwarderToGroup().

unsigned int DtRtiForwarderGroup::connectionCount ( ) const [inline, virtual]

Return a count of all connections existing to the group.

References myConnectedForwarders.

Return a map of all forwarders (keyed by socket) that messages may be received from (ie.

all forwarders in this group with which a connection exists)

References myConnectedForwarders.

bool DtRtiForwarderGroup::connectToForwarder ( const MAKRti::DtString &  fwderName) [virtual]

Add a connection to a non-portal (receive-only) forwarder in the group.

If socket is supplied the peer forwarder must have initiated the connection. Otherwise if the specified forwarder accepts incoming connections a new connection will be initiated. Returns true if connection successful.

unsigned int DtRtiForwarderGroup::connectToPortal ( const MAKRti::DtString &  fwderName = NULL,
bool  ignorePortalFlag = false 
) [virtual]

Add a connection to a portal (send-and-receive) forwarder in the group.

Returns the number of 'portal' connections already established to the group. If the first form is used and the forwarder name is not supplied next group member in the roster capable of acting as a portal will be selected. The second form is to be used when the remote forwarder has initiated the connection. Note: all forwarders in the local host's group will be considered 'portal' forwarders in order that all forwarders in the same group will be fully-connected to other members of the group.

unsigned int DtRtiForwarderGroup::connectToPortal ( DtTcpMsgSocket socket,
bool  ignorePortalFlag = false 
) [virtual]
DtRtiForwarderGroup * DtRtiForwarderGroup::create ( const MAKRti::DtString &  name,
int  defaultPort 
) [static]

Creates an instance of a DtRtiForwarderGroup.

References DtRtiForwarderGroup(), and theCreator.

Referenced by setCreatorFunction().

Disconnect from the specified forwarder, but don't remove from the group.

Disconnect from all forwarders in the group.

References myConnectedForwarders, myConnectionRoster, myConnectionSocketMap, and myPortalForwarders.

Referenced by dissolve().

void DtRtiForwarderGroup::dissolve ( ) [virtual]

Remove (and disconnect from) all forwarders in the group.

References disconnectFromGroup(), and myRoster.

Referenced by ~DtRtiForwarderGroup().

bool DtRtiForwarderGroup::forwarderIsAPortal ( const MAKRti::DtString &  fwderName) const [virtual]

Return value indicates whether the specified group member is a portal (or at least capable of being one, even if it's not being used as the portal to this group at the moment)

References myRoster.

Referenced by DtRouteMap::print(), DtRouteMap::setupSinglePortalRoutes(), and updateNextAvailablePortal().

DtInetAddrAndPort DtRtiForwarderGroup::getForwarderAddrByName ( const MAKRti::DtString &  fwderName) const

Return the IP address of the forwarder based on its name.

References myRoster.

Referenced by isMember(), and DtRouteMap::print().

MAKRti::DtString DtRtiForwarderGroup::getForwarderNameByAddr ( const DtInetAddrAndPort addr) const

Return the name of the forwarder based on its IP address.

References myRoster.

const MAKRti::DtString & DtRtiForwarderGroup::groupName ( ) const [inline, virtual]

Return the group name.

References myName.

Referenced by DtRouteMap::print().

bool DtRtiForwarderGroup::isMember ( const MAKRti::DtString &  fwderName) [virtual]

Return true if the specified forwarder is a member of the group.

References getForwarderAddrByName().

Referenced by DtRouteMap::isLocalGroupMember(), and DtRouteMap::locatePortal().

References myRoster.

References myConnectionSocketMap.

unsigned int DtRtiForwarderGroup::memberCount ( ) const [inline, virtual]

Return a count of all forwarders (connected or not) in the group.

References myRoster.

Referenced by DtRouteMap::setupDefaultRoutes(), DtRouteMap::setupLoadBalanceRoutes(), and DtRouteMap::setupSinglePortalRoutes().

Get pointer to next portal available to accept connection from foreign forwarders in load-balance configurations.

References members(), and myNextAvailablePortal.

Return the map of portals (keyed by socket) (ie.

forwarders in this group that messages will be sent to)

References myPortalForwarders.

unsigned int DtRtiForwarderGroup::portalCount ( ) const [inline, virtual]

Return a count of portal connections to the group.

References myPortalForwarders.

bool DtRtiForwarderGroup::removeForwarder ( const MAKRti::DtString &  fwderName) [virtual]

Remove (and disconnect if necessary) the specified forwarder from the group.

Set the connection manager if it is not provided in the ctor.

References myConnectionMgr.

Referenced by DtInOutForwarderPort::DtInOutForwarderPort().

Call this function to set an alternate creator function With this function, users can replace this DtRtiForwarderGroup with their own derived class.

References create(), and theCreator.

void DtRtiForwarderGroup::setDefaultPort ( int  port) [inline, virtual]

Change the group characteristics.

References myDefaultPort.

void DtRtiForwarderGroup::setForwarderInfo ( const DtInetAddrAndPort addr,
const MAKRti::DtString &  url = NULL,
bool  isPortal = false 
) [virtual]

Change the group member characteristics.

If a connection (socket) to the specified forwarder already exists it will be maintained. However if no connection exists no attempt will be made to initiate a new one. Only the URL and portal designation flag are alterable. This should be sufficient to allow 'replacement' portals to be designated on-the-fly if future needs dictate.

void DtRtiForwarderGroup::setForwarderInfo ( DtTcpMsgSocket socket,
const MAKRti::DtString &  url = NULL,
bool  isPortal = false 
) [virtual]

Update next available portal to select next member in roster capable of acting as a portal.

Wraps around to beginning of roster if necessary. This routine is primarily intended to aid setup of forwarder networks employing load-balancing between groups over the WAN, which implies that there will be more than one portal in each Forwarder Group.

References forwarderIsAPortal(), DtRtiForwarderGroup::DtRtiForwarderGroupMember::myName, myNextAvailablePortal, and myRoster.


Member Data Documentation

Referenced by setConnectionManager().

Connections keyed by forwarder name.

Referenced by disconnectFromGroup().

Connections keyed by socket.

Referenced by disconnectFromGroup(), and isMember().

MAKRti::DtString DtRtiForwarderGroup::myName [protected]

Referenced by groupName().

Aid to keep track of which portal in group is next in line to accept connections from foreign groups in load-balanced configurations.

Referenced by nextAvailablePortal(), and updateNextAvailablePortal().

Socket lists to simplify the task of determining where to transmit messages to (myPortalForwarders) and receive messages from (myConnectedForwarders).

Referenced by disconnectFromGroup(), portalConnections(), and portalCount().

Referenced by create(), and setCreatorFunction().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)