![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: wwwSpyAdapter.h,v $ $Revision: 1.9 $ $State: Exp $ 00007 *******************************************************************************/ 00010 00011 #ifndef DtWwwSpyAdapter_H_ 00012 #define DtWwwSpyAdapter_H_ 00013 00014 #include <rtiMsConfig.h> 00015 #include "webSpyUtils.h" 00016 #include <rtiMsg.h> 00017 #include <RIDparams.h> 00018 #include <vlutil/vlSmartPointers.h> 00019 #include <vlutil/vlFilename.h> 00020 00021 class DtWwwSpyAdapter; 00022 typedef DtBoost::shared_ptr<DtWwwSpyAdapter> DtWwwSpyAdapterSP; 00023 typedef DtBoost::weak_ptr<DtWwwSpyAdapter> DtWwwSpyAdapterWP; 00024 00032 class DT_DLL_WWW DtWwwSpyAdapter 00033 { 00034 private: 00036 DtWwwSpyAdapter( const DtWwwSpyAdapter& ); 00038 DtWwwSpyAdapter& operator=( DtWwwSpyAdapter& ); 00039 00040 public: 00041 00043 typedef DtWwwSpyAdapter* (*CreatorType)( const DtRIDParameters& params, 00044 DtWebSpyUtils::ConnectionType type, unsigned long connId ); 00045 00047 static DtWwwSpyAdapter* create( const DtRIDParameters& params, 00048 DtWebSpyUtils::ConnectionType type, unsigned long connId ); 00049 00051 static void setCreatorFunction( CreatorType creator ); 00052 00053 00057 static bool startWebServerProcess( const DtFilename& processName, 00058 const DtFilename& workingDir, 00059 std::vector<const char*>& args ); 00060 00061 public: 00063 virtual ~DtWwwSpyAdapter(); 00064 00067 virtual bool connectionStatusOk() const; 00068 00069 00071 virtual DtRtiMsg* getNextMsg() = 0; 00072 00074 virtual void postMsg( const DtRtiMsg& msg ) = 0; 00075 00076 protected: 00077 00079 DtWwwSpyAdapter( const DtRIDParameters& params, DtWebSpyUtils::ConnectionType type, 00080 unsigned long connId ); 00081 00084 virtual void initialize(); 00085 00089 virtual bool connectToWebServer() = 0; 00090 00094 virtual bool startWebServer() = 0; 00095 00096 00097 protected: 00098 00099 const DtRIDParameters& myParams; 00100 DtWebSpyUtils::ConnectionType myType; 00101 bool myForwardingEnabled; 00102 DtClock myClock; 00103 unsigned long myConnId; 00104 bool myConnectionStatus; 00105 00106 static unsigned int theMaxConnectionAttempts; 00107 static CreatorType theCreator; 00108 00109 }; 00110 00111 #endif //! DtWwwSpyAdapter_H_