![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: federateDocs.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef DtFederateDocs_H_ 00009 #define DtFederateDocs_H_ 00010 00011 #include <rtiMsConfig.h> 00012 #include "basicEhsDoc.h" 00013 #include "webSpyUtils.h" 00014 #include <vlutil/vlString.h> 00015 #include <vlutil/vlTime.h> 00016 00017 class DtEhsHttpConnectionMgr; 00018 class HttpRequest; 00019 class HttpResponse; 00020 00021 // The XML data block used to pass a single Federate's state to the client 00022 class DT_DLL_WWWEHS DtFederateXML : public DtBasicEhsDoc 00023 { 00024 private: 00025 00026 // Copy Constructor not implimented : Copy not allowed 00027 DtFederateXML(const DtFederateXML&); 00028 // Copy Constructor not implimented : Copy not allowed 00029 DtFederateXML& operator=(const DtFederateXML&); 00030 00031 public: 00032 00033 DtFederateXML( DtEhsHttpConnectionMgr& parent, 00034 const DtWebSpyUtils::ConnectionIdentifier& connInfo ); 00035 virtual ~DtFederateXML(); 00036 00037 protected: 00038 00039 // Serve requests for this page 00040 virtual ResponseCode HandleNonFileRequest( HttpRequest * ipoHttpRequest, 00041 HttpResponse * ipoHttpResponse ); 00042 00043 // Load an initial empty response until first update is available 00044 void initializePage(); 00045 00046 // Send an update request to the Federate 00047 virtual void requestStateUpdate(); 00048 00049 // WWW Request Handlers 00050 00051 // Handler for state requests from the web client 00052 std::auto_ptr< DtString > handleStateRequest( unsigned long connId, 00053 DtWwwRequestXmlBlockSP requestSP, std::auto_ptr< DtString > requestString ); 00054 00055 // Handler for log requests from the web client 00056 std::auto_ptr< DtString > handleLogRequest( unsigned long connId, 00057 DtWwwRequestXmlBlockSP requestSP, std::auto_ptr< DtString > requestString ); 00058 00059 // Handler for RTI Commands 00060 std::auto_ptr< DtString > handleRTICommand( unsigned long connId, 00061 DtWwwRequestXmlBlockSP requestSP, std::auto_ptr< DtString > requestString ); 00062 00063 00064 protected: 00065 00066 typedef std::pair< unsigned long, DtWebSpyUtils::StateComponentType > ComponentIdStateTypePair; 00067 00068 DtEhsHttpConnectionMgr& myParent; 00069 DtWebSpyUtils::ConnectionIdentifier myConnInfo; 00070 00071 00072 // Cache Status - these determine when to request a cache update 00073 // ( and when to wait for the current request to complete ) 00074 std::map< ComponentIdStateTypePair, DtTime > myPendingRequests; 00075 std::map< unsigned long, DtTime > myPendingLrcLogRequests; 00076 00077 }; 00078 00079 #endif // DtFederateDocs_H_