MAK RTIspy API Documentation for HLA 1.3
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DtRtiExecWebManager Class Reference

The DtRtiExecWebManager class stores the current state of the rtiexec as viewable by web clients, and manages the web service which provides to the state to clients. More...

+ Collaboration diagram for DtRtiExecWebManager:

List of all members.

Public Member Functions

 DtRtiExecWebManager (DtRtiexecObserverForWebService &parent, unsigned long connId)
virtual ~DtRtiExecWebManager ()
virtual bool tickOnce ()
 Get any outstanding commands from the WWW server.
const DtString & toXml () const
 Get the Xml representation of the current state.
virtual DtFederationStateXmlBlockSP addFederation (const DtString &federationName, unsigned long federationHandle, const DtString &fedFileName)
 Add and Remove federations from the Federation list.
virtual DtFederationStateXmlBlockSP removeFederation (unsigned long federationHandle)
virtual DtFederateStateXmlBlockSP addFederate (unsigned long connId, unsigned long federationHandle, const DtString &federateName, unsigned long federateHandle, const DtString &host, const DtString &webServerHost, int webServerPort)
 Add and Remove federates from the specified Federation's Federate list.
virtual DtFederateStateXmlBlockSP removeFederate (unsigned long federationHandle, unsigned long federateHandle)
virtual DtTimeStateXmlBlockSP setFederateTimeState (unsigned long federationHandle, unsigned long federateHandle, bool regulating, bool constrained, const DtString &lbts, const DtString &lookahead, const DtString &curTime)
 Update a federate's time-state information.
virtual DtSyncPointXmlBlockSP addSyncPoint (unsigned long federationHandle, const DtString &syncPointName)
 Add and Remove sync points for a federation.
virtual DtSyncPointXmlBlockSP removeSyncPoint (unsigned long federationHandle, const DtString &syncPointName)
virtual
DtSyncPointFederateXmlBlockSP 
addFederateToSyncPoint (unsigned long federationHandle, const DtString &syncPointName, unsigned long federateHandle)
 Add Federate to a sync point.
virtual void syncPointAchieved (unsigned long federationHandle, const DtString &syncPointName, unsigned long federateHandle)
 Achieve a sync point for a federate in the specified federation (simply changes status)
virtual void processFederateStateUpdateMsg (unsigned long connId, unsigned long federationHandle, unsigned long federateHandle, unsigned long stateType, const DtRtiMsg &federateStateMsg)
 Process an incoming Federate State Update message.
virtual void processWwwControlRspMsg (unsigned long connId, unsigned long federationHandle, unsigned long federateHandle, unsigned long commandId, const DtRtiMsg &commandMsg)
 Process an incoming response to a WwwControlMsg message.
virtual void processNetworkMapRspMsg (DtSpyXmlDocumentSP netMap)
 Process an incoming response to a NetworkMapReqMsg message.
DtRtiexecObserverForWebServiceparent ()
 Get a handle to the rtiexec web service parent.
DtWwwSpyAdapterwebServer ()
 Get a handle to the WWW server.

Protected Types

typedef void(DtRtiExecWebManager::* MessageHandlerFn )(const DtRtiMsg *)
typedef std::list
< MessageHandlerFn
MessageHandlerList
typedef std::map< DtRtiMsgKind,
MessageHandlerList
MessageHandlersByKind
typedef std::map< unsigned
long,
DtFederateStateXmlBlockSP
HandleToFederateMap
typedef std::pair
< DtFederationStateXmlBlockSP,
HandleToFederateMap
FederationAndFederatesPair
typedef std::map< unsigned
long,
FederationAndFederatesPair
HandleToFederationMap
typedef std::map< DtString,
DtSyncPointXmlBlockSP
NameToSyncPointMap
typedef std::map< unsigned
long, NameToSyncPointMap
FederationHandleToSyncPointsMap

Protected Member Functions

virtual void refreshFederationStatePage ()
 Send an updated copy of the current XML state to the WWW server.
void refreshNetworkMapPage ()
 Send an updated copy of the current XML network map state to the WWW server.
virtual void registerMsgHandler (DtRtiMsgKind kind, MessageHandlerFn func)
 (Un)Register a handler for a specific msg kind
virtual void unRegisterMsgHandler (DtRtiMsgKind kind, MessageHandlerFn func)
virtual const MessageHandlerListmessageHandlersForKind (DtRtiMsgKind kind)
 Return a list of registered handlers for a given msg kind.
virtual void controlMsgHandler (const DtRtiMsg *msg)
 Callbacks.
virtual void stateReqHandler (const DtRtiMsg *msg)
 Callback for DtWwwStateReqMsgs from WWW.
virtual void federateStateReqHandler (const DtRtiMsg *msg)
 Callback for DtWwwFederateStateReqMsgs.
virtual void issueStateRequest (const DtWwwControlMsg *cntlMsg)
 Handlers for specific requests.
virtual void issueLrcLogRequest (const DtWwwControlMsg *cntlMsg)
 Parse an LRC Log control msg from the WWW and forward it to the target.
virtual void issueDestroyFederationCommand (const DtWwwControlMsg *cntlMsg)
 Parse a Destroy Federation control msg from the WWW and forward it to the target.
virtual void issueDeleteFederateCommand (const DtWwwControlMsg *cntlMsg)
 Parse a Delete Federate control msg from the WWW and forward it to the target.
void issueChangeRidParamsCommand (const DtWwwControlMsg *cntlMsg)
 Parse a Change Rid Params control msg from the WWW and forward it to the target.
void issueUndiscoverObjectCommand (const DtWwwControlMsg *cntlMsg)
 Parse an undiscoverObject control msg from the WWW and forward it to the target.

Protected Attributes

DtRtiexecObserverForWebServicemyParent
 Owning Exec Observer.
unsigned long myConnId
DtWwwSpyAdapterSP myWebAdapter
 Interface to the web-server.
DtSpyXmlDocument myXmlStateRepository
 XML state rep for the rtiexec.
DtFederationListXmlBlockSP myFederationList
DtSpyXmlDocumentSP myXmlNetworkMapStateRepository
 Network Map State Repository NOTE: we only store the document here - it is built at the forwarder (so there is no corresponding xml block)
HandleToFederationMap myFederations
FederationHandleToSyncPointsMap mySyncPoints
MessageHandlersByKind myMessageHandlers
 List of message kind handlers.

Detailed Description

The DtRtiExecWebManager class stores the current state of the rtiexec as viewable by web clients, and manages the web service which provides to the state to clients.


Member Typedef Documentation

typedef std::map< unsigned long, NameToSyncPointMap> DtRtiExecWebManager::FederationHandleToSyncPointsMap [protected]
typedef std::map< unsigned long, DtFederateStateXmlBlockSP > DtRtiExecWebManager::HandleToFederateMap [protected]
typedef std::map< unsigned long, FederationAndFederatesPair > DtRtiExecWebManager::HandleToFederationMap [protected]
typedef void( DtRtiExecWebManager::* DtRtiExecWebManager::MessageHandlerFn)(const DtRtiMsg *) [protected]
typedef std::map< DtString, DtSyncPointXmlBlockSP > DtRtiExecWebManager::NameToSyncPointMap [protected]

Constructor & Destructor Documentation


Member Function Documentation

DtFederateStateXmlBlockSP DtRtiExecWebManager::addFederate ( unsigned long  connId,
unsigned long  federationHandle,
const DtString &  federateName,
unsigned long  federateHandle,
const DtString &  host,
const DtString &  webServerHost,
int  webServerPort 
) [virtual]

Add and Remove federates from the specified Federation's Federate list.

References myFederations, and refreshFederationStatePage().

DtSyncPointFederateXmlBlockSP DtRtiExecWebManager::addFederateToSyncPoint ( unsigned long  federationHandle,
const DtString &  syncPointName,
unsigned long  federateHandle 
) [virtual]

Add Federate to a sync point.

References mySyncPoints, and refreshFederationStatePage().

DtFederationStateXmlBlockSP DtRtiExecWebManager::addFederation ( const DtString &  federationName,
unsigned long  federationHandle,
const DtString &  fedFileName 
) [virtual]

Add and Remove federations from the Federation list.

References myFederationList, myFederations, and refreshFederationStatePage().

DtSyncPointXmlBlockSP DtRtiExecWebManager::addSyncPoint ( unsigned long  federationHandle,
const DtString &  syncPointName 
) [virtual]

Add and Remove sync points for a federation.

References myFederations, mySyncPoints, and refreshFederationStatePage().

void DtRtiExecWebManager::controlMsgHandler ( const DtRtiMsg msg) [protected, virtual]
void DtRtiExecWebManager::federateStateReqHandler ( const DtRtiMsg msg) [protected, virtual]

Parse a Change Rid Params control msg from the WWW and forward it to the target.

References DtRtiMsg::fedExHandle(), myFederations, myParent, and DtRtiexecObserverForWebService::sendMsgToFederation().

Referenced by controlMsgHandler().

void DtRtiExecWebManager::issueDeleteFederateCommand ( const DtWwwControlMsg cntlMsg) [protected, virtual]

Parse a Delete Federate control msg from the WWW and forward it to the target.

References DtWwwControlMsg::command(), DtRtiexecObserverForWebService::deleteFederate(), federationName(), and myParent.

Referenced by controlMsgHandler().

void DtRtiExecWebManager::issueDestroyFederationCommand ( const DtWwwControlMsg cntlMsg) [protected, virtual]

Parse a Destroy Federation control msg from the WWW and forward it to the target.

References DtWwwControlMsg::command(), DtRtiexecObserverForWebService::destroyFederation(), federationName(), and myParent.

Referenced by controlMsgHandler().

void DtRtiExecWebManager::issueLrcLogRequest ( const DtWwwControlMsg cntlMsg) [protected, virtual]

Parse an LRC Log control msg from the WWW and forward it to the target.

References DtRtiMsg::fedExHandle(), myFederations, myParent, and DtRtiexecObserverForWebService::sendMsgToFederation().

Referenced by controlMsgHandler().

void DtRtiExecWebManager::issueStateRequest ( const DtWwwControlMsg cntlMsg) [protected, virtual]

Parse an undiscoverObject control msg from the WWW and forward it to the target.

References DtRtiMsg::fedExHandle(), myFederations, myParent, and DtRtiexecObserverForWebService::sendMsgToFederation().

Referenced by controlMsgHandler().

Return a list of registered handlers for a given msg kind.

References myMessageHandlers.

Referenced by tickOnce().

Get a handle to the rtiexec web service parent.

References myParent.

void DtRtiExecWebManager::processFederateStateUpdateMsg ( unsigned long  connId,
unsigned long  federationHandle,
unsigned long  federateHandle,
unsigned long  stateType,
const DtRtiMsg federateStateMsg 
) [virtual]

Process an incoming Federate State Update message.

References myFederations, and myWebAdapter.

Process an incoming response to a NetworkMapReqMsg message.

References myXmlNetworkMapStateRepository, and refreshNetworkMapPage().

void DtRtiExecWebManager::processWwwControlRspMsg ( unsigned long  connId,
unsigned long  federationHandle,
unsigned long  federateHandle,
unsigned long  commandId,
const DtRtiMsg commandMsg 
) [virtual]

Process an incoming response to a WwwControlMsg message.

References myFederations, and myWebAdapter.

void DtRtiExecWebManager::refreshFederationStatePage ( ) [protected, virtual]

Send an updated copy of the current XML network map state to the WWW server.

References DtMAX_FRAGMENT_SIZE, DtWebSpyUtils::DtNetworkMapStateType, myConnId, myWebAdapter, and myXmlNetworkMapStateRepository.

Referenced by processNetworkMapRspMsg(), and stateReqHandler().

void DtRtiExecWebManager::registerMsgHandler ( DtRtiMsgKind  kind,
MessageHandlerFn  func 
) [protected, virtual]

(Un)Register a handler for a specific msg kind

References myMessageHandlers.

Referenced by DtRtiExecWebManager().

DtFederateStateXmlBlockSP DtRtiExecWebManager::removeFederate ( unsigned long  federationHandle,
unsigned long  federateHandle 
) [virtual]
DtFederationStateXmlBlockSP DtRtiExecWebManager::removeFederation ( unsigned long  federationHandle) [virtual]
DtSyncPointXmlBlockSP DtRtiExecWebManager::removeSyncPoint ( unsigned long  federationHandle,
const DtString &  syncPointName 
) [virtual]
DtTimeStateXmlBlockSP DtRtiExecWebManager::setFederateTimeState ( unsigned long  federationHandle,
unsigned long  federateHandle,
bool  regulating,
bool  constrained,
const DtString &  lbts,
const DtString &  lookahead,
const DtString &  curTime 
) [virtual]

Update a federate's time-state information.

References myFederations, and refreshFederationStatePage().

void DtRtiExecWebManager::stateReqHandler ( const DtRtiMsg msg) [protected, virtual]
void DtRtiExecWebManager::syncPointAchieved ( unsigned long  federationHandle,
const DtString &  syncPointName,
unsigned long  federateHandle 
) [virtual]

Achieve a sync point for a federate in the specified federation (simply changes status)

References mySyncPoints, and refreshFederationStatePage().

Get any outstanding commands from the WWW server.

References messageHandlersForKind(), DtRtiMsg::msgKind(), and myWebAdapter.

const DtString & DtRtiExecWebManager::toXml ( ) const [inline]

Get the Xml representation of the current state.

References myXmlStateRepository, and DtSpyXmlDocument::toString().

Referenced by refreshFederationStatePage().

void DtRtiExecWebManager::unRegisterMsgHandler ( DtRtiMsgKind  kind,
MessageHandlerFn  func 
) [protected, virtual]

References myMessageHandlers.

Get a handle to the WWW server.

References myWebAdapter.


Member Data Documentation

unsigned long DtRtiExecWebManager::myConnId [protected]

List of message kind handlers.

Referenced by messageHandlersForKind(), registerMsgHandler(), and unRegisterMsgHandler().

Network Map State Repository NOTE: we only store the document here - it is built at the forwarder (so there is no corresponding xml block)

Referenced by processNetworkMapRspMsg(), and refreshNetworkMapPage().

XML state rep for the rtiexec.

Referenced by toXml().


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)