![]() |
MAK RTIspy API Documentation for HLA Evolved
|
The DtForwarderWebManager class stores the current state of a single LRC as viewable by web clients, and manages the web service which provides to the state to clients. More...
Collaboration diagram for DtForwarderWebManager:Public Types | |
| typedef bool(DtForwarderWebManager::* | NetworkMapMsgRspHandlerMemberCb )(MAKRti::DtInetAddr src, const DtNetworkMapRspMsg &msg) |
| Pointer to member function callbacks used by the port filters. | |
Public Member Functions | |
| DtForwarderWebManager (DtBoost::shared_ptr< DtForwarderNode > parent) | |
| Ctor / Dtor. | |
| virtual | ~DtForwarderWebManager () |
| virtual MAKRti::DtString | printableNetworkMap (bool drawTree=true) const |
| Get a human readable string containing the current network map Suitable for writing to an output stream If drawTree Then draw map as a Tree rooted at this forwarder. | |
| virtual DtSpyXmlDocumentSP | getNetworkMap () const |
| Get a handle to the current network map (for printing, etc.) | |
| virtual bool | tick (double maxTime) |
| Give the Web manager time to process any messages arriving from the local HTTP connection. | |
Static Public Member Functions | |
| static void | requestComplete (DtNetworkMapRspMsg &msg, void *usr) |
| Callback for completed network map requests from the network map processor. | |
Protected Types | |
| typedef void(DtForwarderWebManager::* | MessageHandlerFn )(const DtRtiMsg *) |
| typedef std::list < MessageHandlerFn > | MessageHandlerList |
| typedef std::map< DtRtiMsgKind, MessageHandlerList > | MessageHandlersByKind |
Protected Member Functions | |
| void | requestComplete (DtNetworkMapRspMsg &msg) |
| Callback for completed network map requests from the network map processor. | |
| 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 | handleWwwCommandMsg (const DtRtiMsg *) |
| WWW Message Handlers. | |
| virtual void | handleStateRequestMsg (const DtRtiMsg *msg) |
| virtual DtWwwControlRspMsg * | buildWwwCommandResponse (DtWebSpyUtils::WwwControlMsgCommandId commandType, const MAKRti::DtString &commandString) |
| Build the substance of the responses. | |
| virtual std::auto_ptr < MAKRti::DtString > | buildWwwStateResponse (DtWebSpyUtils::StateComponentType requestType) |
| virtual void | issueNetworkMapRequest () const |
| Issue a network map request. | |
| void | printForwarder (DtNetMapForwarderXmlBlockSP forwarderSP, MAKRti::DtString &target, MAKRti::DtString indentLevel, bool drawTree=true) const |
| Helper method for generating a printable string from an XML network map. | |
Protected Attributes | |
| DtClock | myClock |
| unsigned long | myConnId |
| DtBoost::shared_ptr < DtForwarderNode > | myParent |
| DtNetworkMapProcessor * | myNetworkMapProcessor |
| std::auto_ptr< DtWwwSpyAdapter > | myWebAdapter |
| MessageHandlersByKind | myMessageHandlers |
| DtSpyXmlDocumentSP | myXmlNetworkMapDoc |
| Current Network Map state repository. | |
The DtForwarderWebManager class stores the current state of a single LRC as viewable by web clients, and manages the web service which provides to the state to clients.
IMPORTANT: The DtForwarderWebManager uses libxml2. Libxml2 is only safe to use in a secondary thread after calling xmlInitParser() ( done through appEnvInit() )
typedef void( DtForwarderWebManager::* DtForwarderWebManager::MessageHandlerFn)(const DtRtiMsg *) [protected] |
typedef std::list< MessageHandlerFn > DtForwarderWebManager::MessageHandlerList [protected] |
typedef std::map< DtRtiMsgKind, MessageHandlerList > DtForwarderWebManager::MessageHandlersByKind [protected] |
| typedef bool(DtForwarderWebManager::* DtForwarderWebManager::NetworkMapMsgRspHandlerMemberCb)(MAKRti::DtInetAddr src, const DtNetworkMapRspMsg &msg) |
Pointer to member function callbacks used by the port filters.
| DtForwarderWebManager::DtForwarderWebManager | ( | DtBoost::shared_ptr< DtForwarderNode > | parent | ) |
Ctor / Dtor.
References DtNetworkMapProcessor::addRequestCompletedCb(), DtTcpWwwSpyAdapter::create(), DtWwwSpyAdapter::create(), DtWebSpyUtils::DtForwarderConnection, DtWwwControlMsgKind, DtWwwStateReqMsgKind, handleStateRequestMsg(), handleWwwCommandMsg(), myConnId, myNetworkMapProcessor, myParent, myWebAdapter, registerMsgHandler(), requestComplete(), and DtWwwSpyAdapter::setCreatorFunction().
| DtForwarderWebManager::~DtForwarderWebManager | ( | ) | [virtual] |
| DtWwwControlRspMsg * DtForwarderWebManager::buildWwwCommandResponse | ( | DtWebSpyUtils::WwwControlMsgCommandId | commandType, |
| const MAKRti::DtString & | commandString | ||
| ) | [protected, virtual] |
Build the substance of the responses.
References DtWebSpyUtils::DtNetworkMapMsg, DtWebSpyUtils::DtTypeInfoCntlMsg, issueNetworkMapRequest(), myConnId, myXmlNetworkMapDoc, and DtSpyXmlDocument::root().
Referenced by handleWwwCommandMsg().
| std::auto_ptr< MAKRti::DtString > DtForwarderWebManager::buildWwwStateResponse | ( | DtWebSpyUtils::StateComponentType | requestType | ) | [protected, virtual] |
References DtWebSpyUtils::DtNetworkMapStateType, issueNetworkMapRequest(), and myXmlNetworkMapDoc.
Referenced by handleStateRequestMsg().
| DtSpyXmlDocumentSP DtForwarderWebManager::getNetworkMap | ( | ) | const [virtual] |
Get a handle to the current network map (for printing, etc.)
References issueNetworkMapRequest(), and myXmlNetworkMapDoc.
| void DtForwarderWebManager::handleStateRequestMsg | ( | const DtRtiMsg * | msg | ) | [protected, virtual] |
References buildWwwStateResponse(), DtMAX_FRAGMENT_SIZE, myConnId, myWebAdapter, and DtWwwStateReqMsg::requestType().
Referenced by DtForwarderWebManager().
| void DtForwarderWebManager::handleWwwCommandMsg | ( | const DtRtiMsg * | msg | ) | [protected, virtual] |
WWW Message Handlers.
References buildWwwCommandResponse(), DtWwwControlMsg::command(), DtWwwControlMsg::commandId(), and myWebAdapter.
Referenced by DtForwarderWebManager().
| void DtForwarderWebManager::issueNetworkMapRequest | ( | ) | const [protected, virtual] |
Issue a network map request.
References DtNetworkMapProcessor::gotNetworkMapRequest(), myConnId, myNetworkMapProcessor, and myParent.
Referenced by buildWwwCommandResponse(), buildWwwStateResponse(), getNetworkMap(), and printableNetworkMap().
| const DtForwarderWebManager::MessageHandlerList & DtForwarderWebManager::messageHandlersForKind | ( | DtRtiMsgKind | kind | ) | [protected, virtual] |
Return a list of registered handlers for a given msg kind.
References myMessageHandlers.
| MAKRti::DtString DtForwarderWebManager::printableNetworkMap | ( | bool | drawTree = true | ) | const [virtual] |
Get a human readable string containing the current network map Suitable for writing to an output stream If drawTree Then draw map as a Tree rooted at this forwarder.
References DtNetMapXmlBlock::childForwarders(), issueNetworkMapRequest(), myXmlNetworkMapDoc, and printForwarder().
| void DtForwarderWebManager::printForwarder | ( | DtNetMapForwarderXmlBlockSP | forwarderSP, |
| MAKRti::DtString & | target, | ||
| MAKRti::DtString | indentLevel, | ||
| bool | drawTree = true |
||
| ) | const [protected] |
Helper method for generating a printable string from an XML network map.
Referenced by printableNetworkMap().
| void DtForwarderWebManager::registerMsgHandler | ( | DtRtiMsgKind | kind, |
| DtForwarderWebManager::MessageHandlerFn | func | ||
| ) | [protected, virtual] |
(Un)Register a handler for a specific msg kind
References myMessageHandlers.
Referenced by DtForwarderWebManager().
| void DtForwarderWebManager::requestComplete | ( | DtNetworkMapRspMsg & | msg, |
| void * | usr | ||
| ) | [static] |
Callback for completed network map requests from the network map processor.
Referenced by DtForwarderWebManager(), and ~DtForwarderWebManager().
| void DtForwarderWebManager::requestComplete | ( | DtNetworkMapRspMsg & | msg | ) | [protected] |
Callback for completed network map requests from the network map processor.
References myXmlNetworkMapDoc, and DtNetworkMapRspMsg::payload().
| bool DtForwarderWebManager::tick | ( | double | maxTime | ) | [virtual] |
Give the Web manager time to process any messages arriving from the local HTTP connection.
References DtRtiMsg::msgKind(), myClock, myMessageHandlers, and myWebAdapter.
| void DtForwarderWebManager::unRegisterMsgHandler | ( | DtRtiMsgKind | kind, |
| DtForwarderWebManager::MessageHandlerFn | func | ||
| ) | [protected, virtual] |
References myMessageHandlers.
DtClock DtForwarderWebManager::myClock [protected] |
Referenced by tick().
unsigned long DtForwarderWebManager::myConnId [protected] |
Referenced by buildWwwCommandResponse(), DtForwarderWebManager(), handleStateRequestMsg(), and issueNetworkMapRequest().
Referenced by messageHandlersForKind(), registerMsgHandler(), tick(), and unRegisterMsgHandler().
Referenced by DtForwarderWebManager(), issueNetworkMapRequest(), and ~DtForwarderWebManager().
DtBoost::shared_ptr<DtForwarderNode> DtForwarderWebManager::myParent [protected] |
Referenced by DtForwarderWebManager(), and issueNetworkMapRequest().
std::auto_ptr<DtWwwSpyAdapter> DtForwarderWebManager::myWebAdapter [protected] |
Referenced by DtForwarderWebManager(), handleStateRequestMsg(), handleWwwCommandMsg(), and tick().
Current Network Map state repository.
Referenced by buildWwwCommandResponse(), buildWwwStateResponse(), getNetworkMap(), printableNetworkMap(), and requestComplete().