MAK RTIspy API Documentation for HLA 1.3
forwarderWebManager.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 2006 MaK Technologies, Inc.
00003  ** All rights reserved.
00004  *********************************************************************/
00005 /*******************************************************************************
00006  ** $RCSfile: forwarderWebManager.h,v $ $Revision: 1.2 $ $State: Exp $
00007  *******************************************************************************/
00010 
00011 #ifndef DtForwarderWebManager_H_
00012 #define DtForwarderWebManager_H_
00013 
00014 #include <rtiMsConfig.h>
00015 #include <spyXmlDocument.h>
00016 #include <wwwSpyAdapter.h>
00017 #include <wwwRequestXmlBlock.h>
00018 #include <netMapForwarderXmlBlock.h>
00019 #include <vlutil/vlThreadSafe.h>
00020 #include <rtiMsg.h>
00021 #include <vlutil/vlTime.h>
00022 #include <deque>
00023 
00024 class DtForwarderNode;
00025 class DtNetworkMapProcessor;
00026 class DtWwwControlRspMsg;
00027 class DtNetworkMapRspMsg;
00028 
00035 class DT_DLL_FORWARDER DtForwarderWebManager
00036 {
00037 public:
00038       
00040    typedef bool (DtForwarderWebManager::* NetworkMapMsgRspHandlerMemberCb)(
00041       MAKRti::DtInetAddr src, const DtNetworkMapRspMsg& msg  );
00042 
00043 public:
00044    
00046    DtForwarderWebManager( DtBoost::shared_ptr<DtForwarderNode> parent );
00047    virtual ~DtForwarderWebManager();
00048 
00052    virtual MAKRti::DtString printableNetworkMap( bool drawTree = true ) const;
00053 
00055    virtual DtSpyXmlDocumentSP getNetworkMap() const;
00056 
00059    virtual bool tick( double maxTime );
00060 
00061 public:
00062    
00064    static void requestComplete( DtNetworkMapRspMsg& msg, void* usr );
00065 
00066 protected:
00067 
00068    typedef void ( DtForwarderWebManager::*MessageHandlerFn)( const DtRtiMsg* );
00069    typedef std::list< MessageHandlerFn > MessageHandlerList;
00070    typedef std::map< DtRtiMsgKind, MessageHandlerList > MessageHandlersByKind;
00071 
00073    void requestComplete( DtNetworkMapRspMsg& msg );
00074    
00076    virtual void registerMsgHandler( DtRtiMsgKind kind, MessageHandlerFn func );
00077    virtual void unRegisterMsgHandler( DtRtiMsgKind kind, MessageHandlerFn func );
00078 
00080    virtual const MessageHandlerList& messageHandlersForKind( DtRtiMsgKind kind );
00081 
00083    virtual void handleWwwCommandMsg( const DtRtiMsg* );
00084    virtual void handleStateRequestMsg( const DtRtiMsg* msg );
00085 
00086 
00088    virtual DtWwwControlRspMsg* buildWwwCommandResponse(
00089       DtWebSpyUtils::WwwControlMsgCommandId commandType, const MAKRti::DtString& commandString );
00090    virtual std::auto_ptr<MAKRti::DtString> buildWwwStateResponse( 
00091       DtWebSpyUtils::StateComponentType requestType );
00092 
00093 
00095    virtual void issueNetworkMapRequest() const;
00096 
00098    void printForwarder( DtNetMapForwarderXmlBlockSP forwarderSP, MAKRti::DtString& target,
00099       MAKRti::DtString indentLevel, bool drawTree = true ) const;
00100    
00101 protected:
00102 
00103    DtClock myClock;
00104    unsigned long myConnId;
00105    DtBoost::shared_ptr<DtForwarderNode> myParent;
00106    DtNetworkMapProcessor* myNetworkMapProcessor;
00107    std::auto_ptr<DtWwwSpyAdapter> myWebAdapter;
00108    MessageHandlersByKind myMessageHandlers;
00109 
00111    DtSpyXmlDocumentSP myXmlNetworkMapDoc;
00112 };
00113 
00114 
00115 #endif //! DtForwarderWebManager_H_

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)