![]() |
MAK RTIspy API Documentation for HLA 1516
|
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: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. | |
| DtRtiexecObserverForWebService & | parent () |
| Get a handle to the rtiexec web service parent. | |
| DtWwwSpyAdapter & | webServer () |
| 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 MessageHandlerList & | messageHandlersForKind (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 | |
| DtRtiexecObserverForWebService & | myParent |
| 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. | |
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.
typedef std::pair< DtFederationStateXmlBlockSP, HandleToFederateMap > DtRtiExecWebManager::FederationAndFederatesPair [protected] |
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::list< MessageHandlerFn > DtRtiExecWebManager::MessageHandlerList [protected] |
typedef std::map< DtRtiMsgKind, MessageHandlerList > DtRtiExecWebManager::MessageHandlersByKind [protected] |
typedef std::map< DtString, DtSyncPointXmlBlockSP > DtRtiExecWebManager::NameToSyncPointMap [protected] |
| DtRtiExecWebManager::DtRtiExecWebManager | ( | DtRtiexecObserverForWebService & | parent, |
| unsigned long | connId | ||
| ) |
References controlMsgHandler(), DtTcpWwwSpyAdapter::create(), DtWwwSpyAdapter::create(), DtWebSpyUtils::DtRtiExecConnection, DtWebSpyUtils::DtRtiExecConnectionLightweight, DtWwwControlMsgKind, DtWwwFederateStateReqMsgKind, DtWwwStateReqMsgKind, federateStateReqHandler(), myConnId, myFederationList, myWebAdapter, DtRtiexecObserverForWebService::params(), registerMsgHandler(), DtWwwSpyAdapter::setCreatorFunction(), and stateReqHandler().
| DtRtiExecWebManager::~DtRtiExecWebManager | ( | ) | [virtual] |
| 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] |
Callbacks.
Callback for DtWwwControlMsgs from WWW
References DtWwwControlMsg::command(), DtWwwControlMsg::commandId(), DtWebSpyUtils::DtChangeRidParamMsg, DtWebSpyUtils::DtDeleteFederateCmdMsg, DtWebSpyUtils::DtDestroyFederationCmdMsg, DtWebSpyUtils::DtLrcLogEventsMsg, DtWebSpyUtils::DtRequestStateUpdateMsg, DtWebSpyUtils::DtUndiscoverObjectMsg, issueChangeRidParamsCommand(), issueDeleteFederateCommand(), issueDestroyFederationCommand(), issueLrcLogRequest(), issueStateRequest(), and issueUndiscoverObjectCommand().
Referenced by DtRtiExecWebManager().
| void DtRtiExecWebManager::federateStateReqHandler | ( | const DtRtiMsg * | msg | ) | [protected, virtual] |
Callback for DtWwwFederateStateReqMsgs.
References DtRtiMsg::fedExHandle(), myFederations, myParent, DtWwwFederateStateReqMsg::requestType(), DtRtiexecObserverForWebService::sendMsgToFederation(), DtWwwFederateStateReqMsg::targetConnectionId(), and DtWwwFederateStateReqMsg::targetFederateHandle().
Referenced by DtRtiExecWebManager().
| void DtRtiExecWebManager::issueChangeRidParamsCommand | ( | const DtWwwControlMsg * | cntlMsg | ) | [protected] |
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] |
Handlers for specific requests.
Parse a State Request control msg from the WWW and forward it to the target
References DtWwwControlMsg::connectionId(), DtWebSpyUtils::DtBaseStateType, DtRtiMsg::fedExHandle(), myConnId, myFederations, myParent, refreshFederationStatePage(), DtRtiexecObserverForWebService::sendMsgToFederation(), DtWwwControlMsg::targetFederateHandle(), and true.
Referenced by controlMsgHandler().
| void DtRtiExecWebManager::issueUndiscoverObjectCommand | ( | const DtWwwControlMsg * | cntlMsg | ) | [protected] |
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().
| const DtRtiExecWebManager::MessageHandlerList & DtRtiExecWebManager::messageHandlersForKind | ( | DtRtiMsgKind | kind | ) | [protected, virtual] |
Return a list of registered handlers for a given msg kind.
References myMessageHandlers.
Referenced by tickOnce().
| DtRtiexecObserverForWebService & DtRtiExecWebManager::parent | ( | ) | [inline] |
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.
| void DtRtiExecWebManager::processNetworkMapRspMsg | ( | DtSpyXmlDocumentSP | netMap | ) | [virtual] |
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 state to the WWW server.
References DtWebSpyUtils::DtBaseStateType, myConnId, myWebAdapter, and toXml().
Referenced by addFederate(), addFederateToSyncPoint(), addFederation(), addSyncPoint(), issueStateRequest(), removeFederate(), removeFederation(), removeSyncPoint(), setFederateTimeState(), stateReqHandler(), and syncPointAchieved().
| void DtRtiExecWebManager::refreshNetworkMapPage | ( | ) | [protected] |
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] |
References myFederations, and refreshFederationStatePage().
| DtFederationStateXmlBlockSP DtRtiExecWebManager::removeFederation | ( | unsigned long | federationHandle | ) | [virtual] |
References myFederationList, myFederations, and refreshFederationStatePage().
| DtSyncPointXmlBlockSP DtRtiExecWebManager::removeSyncPoint | ( | unsigned long | federationHandle, |
| const DtString & | syncPointName | ||
| ) | [virtual] |
References mySyncPoints, and refreshFederationStatePage().
| 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] |
Callback for DtWwwStateReqMsgs from WWW.
References DtWebSpyUtils::DtNetworkMapStateType, myConnId, myParent, refreshFederationStatePage(), refreshNetworkMapPage(), DtWwwStateReqMsg::requestType(), and DtRtiexecObserverForWebService::sendMsgToFederation().
Referenced by DtRtiExecWebManager().
| 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().
| bool DtRtiExecWebManager::tickOnce | ( | ) | [virtual] |
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.
| DtWwwSpyAdapter & DtRtiExecWebManager::webServer | ( | ) | [inline] |
Get a handle to the WWW server.
References myWebAdapter.
unsigned long DtRtiExecWebManager::myConnId [protected] |
Referenced by DtRtiExecWebManager(), issueStateRequest(), refreshFederationStatePage(), refreshNetworkMapPage(), and stateReqHandler().
Referenced by addFederation(), DtRtiExecWebManager(), and removeFederation().
Referenced by addFederate(), addFederation(), addSyncPoint(), federateStateReqHandler(), issueChangeRidParamsCommand(), issueLrcLogRequest(), issueStateRequest(), issueUndiscoverObjectCommand(), processFederateStateUpdateMsg(), processWwwControlRspMsg(), removeFederate(), removeFederation(), and setFederateTimeState().
List of message kind handlers.
Referenced by messageHandlersForKind(), registerMsgHandler(), and unRegisterMsgHandler().
Owning Exec Observer.
Referenced by federateStateReqHandler(), issueChangeRidParamsCommand(), issueDeleteFederateCommand(), issueDestroyFederationCommand(), issueLrcLogRequest(), issueStateRequest(), issueUndiscoverObjectCommand(), parent(), and stateReqHandler().
Referenced by addFederateToSyncPoint(), addSyncPoint(), removeSyncPoint(), and syncPointAchieved().
DtWwwSpyAdapterSP DtRtiExecWebManager::myWebAdapter [protected] |
Interface to the web-server.
Referenced by DtRtiExecWebManager(), processFederateStateUpdateMsg(), processWwwControlRspMsg(), refreshFederationStatePage(), refreshNetworkMapPage(), tickOnce(), and webServer().
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().