MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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:

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

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.

virtual DtRtiForwarderGroup::~DtRtiForwarderGroup ( )
virtual

Destructor.

Member Function Documentation

virtual 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.

unsigned int DtRtiForwarderGroup::connectionCount ( ) const
inlinevirtual

Return a count of all connections existing to the group.

References myConnectedForwarders.

const DtRtiForwarderGroup::DtForwarderGroupConnectionList & DtRtiForwarderGroup::connections ( ) const
inlinevirtual

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.

virtual 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.

virtual bool DtRtiForwarderGroup::connectToForwarder ( DtTcpMsgSocket socket)
virtual
virtual 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.

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

Creates an instance of a DtRtiForwarderGroup.

virtual bool DtRtiForwarderGroup::disconnectFromForwarder ( DtTcpMsgSocket socket)
virtual

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

virtual void DtRtiForwarderGroup::disconnectFromGroup ( )
virtual

Disconnect from all forwarders in the group.

virtual void DtRtiForwarderGroup::dissolve ( )
virtual

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

virtual 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)

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

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

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

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

const MAKRti::DtString & DtRtiForwarderGroup::groupName ( ) const
inlinevirtual

Return the group name.

References myName.

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

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

virtual bool DtRtiForwarderGroup::isMember ( const DtInetAddrAndPort addr)
virtual
virtual bool DtRtiForwarderGroup::isMember ( DtTcpMsgSocket sock)
virtual
unsigned int DtRtiForwarderGroup::memberCount ( ) const
inlinevirtual

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

References myRoster.

virtual const DtForwarderGroupMemberList DtRtiForwarderGroup::members ( ) const
virtual

Return the map of all forwarders (keyed by name) in the group.

Referenced by nextAvailablePortal().

DtRtiForwarderGroup::DtRtiForwarderGroupMember * DtRtiForwarderGroup::nextAvailablePortal ( )
inlinevirtual

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

References members(), and myNextAvailablePortal.

const DtRtiForwarderGroup::DtForwarderGroupConnectionList & DtRtiForwarderGroup::portalConnections ( ) const
inlinevirtual

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
inlinevirtual

Return a count of portal connections to the group.

References myPortalForwarders.

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

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

virtual bool DtRtiForwarderGroup::removeForwarder ( DtTcpMsgSocket socket)
virtual
virtual void DtRtiForwarderGroup::setConnectionManager ( DtPeerToPeerTcpSockMgr connMgr)
virtual

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

static void DtRtiForwarderGroup::setCreatorFunction ( DtForwarderGroupCreatorFcn  creator)
static

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

void DtRtiForwarderGroup::setDefaultPort ( int  port)
inlinevirtual

Change the group characteristics.

References myDefaultPort.

virtual 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.

virtual void DtRtiForwarderGroup::setForwarderInfo ( DtTcpMsgSocket socket,
const MAKRti::DtString &  url = NULL,
bool  isPortal = false 
)
virtual
virtual bool DtRtiForwarderGroup::updateNextAvailablePortal ( )
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.

Member Data Documentation

DtForwarderGroupConnectionList DtRtiForwarderGroup::myConnectedForwarders
protected

Referenced by connectionCount(), and connections().

DtPeerToPeerTcpSockMgr* DtRtiForwarderGroup::myConnectionMgr
protected
DtForwarderGroupMemberList DtRtiForwarderGroup::myConnectionRoster
protected

Connections keyed by forwarder name.

DtForwarderGroupConnectionList DtRtiForwarderGroup::myConnectionSocketMap
protected

Connections keyed by socket.

int DtRtiForwarderGroup::myDefaultPort
protected

Referenced by setDefaultPort().

MAKRti::DtString DtRtiForwarderGroup::myName
protected

Referenced by groupName().

DtRtiForwarderGroup::DtRtiForwarderGroupMember* DtRtiForwarderGroup::myNextAvailablePortal
protected

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().

DtForwarderGroupConnectionList DtRtiForwarderGroup::myPortalForwarders
protected

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

Referenced by portalConnections(), and portalCount().

DtForwarderGroupMemberList DtRtiForwarderGroup::myRoster
protected

Group member list keyed by forwarder name.

Referenced by memberCount().

DtForwarderGroupCreatorFcn DtRtiForwarderGroup::theCreator
staticprotected

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

Document ID: Generated on Mon Jul 9 10:30:41 EDT 2018 from SVN revision 190224
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)