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

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:

List of all members.

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 MessageHandlerListmessageHandlersForKind (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 DtWwwControlRspMsgbuildWwwCommandResponse (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
DtNetworkMapProcessormyNetworkMapProcessor
std::auto_ptr< DtWwwSpyAdaptermyWebAdapter
MessageHandlersByKind myMessageHandlers
DtSpyXmlDocumentSP myXmlNetworkMapDoc
 Current Network Map state repository.

Detailed Description

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


Member Typedef Documentation

typedef void( DtForwarderWebManager::* DtForwarderWebManager::MessageHandlerFn)(const DtRtiMsg *) [protected]
typedef bool(DtForwarderWebManager::* DtForwarderWebManager::NetworkMapMsgRspHandlerMemberCb)(MAKRti::DtInetAddr src, const DtNetworkMapRspMsg &msg)

Pointer to member function callbacks used by the port filters.


Constructor & Destructor Documentation


Member Function Documentation

DtWwwControlRspMsg * DtForwarderWebManager::buildWwwCommandResponse ( DtWebSpyUtils::WwwControlMsgCommandId  commandType,
const MAKRti::DtString &  commandString 
) [protected, virtual]
std::auto_ptr< MAKRti::DtString > DtForwarderWebManager::buildWwwStateResponse ( DtWebSpyUtils::StateComponentType  requestType) [protected, virtual]

Get a handle to the current network map (for printing, etc.)

References issueNetworkMapRequest(), and myXmlNetworkMapDoc.

void DtForwarderWebManager::handleStateRequestMsg ( const DtRtiMsg msg) [protected, virtual]
void DtForwarderWebManager::handleWwwCommandMsg ( const DtRtiMsg msg) [protected, virtual]
void DtForwarderWebManager::issueNetworkMapRequest ( ) const [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().

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

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.

References myMessageHandlers.


Member Data Documentation

DtClock DtForwarderWebManager::myClock [protected]

Referenced by tick().

unsigned long DtForwarderWebManager::myConnId [protected]
DtBoost::shared_ptr<DtForwarderNode> DtForwarderWebManager::myParent [protected]

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)