![]() |
MAK RTIspy API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 2008 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: baseConfig.h,v $ $Revision: 1.3 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00012 #ifndef DtBaseConfig_H_ 00013 #define DtBaseConfig_H_ 00014 00015 #include "rtiMsConfig.h" 00016 #include <mtl/env.h> 00017 #include <mtl/envXMLWriter.h> 00018 #include <vlutil/vlString.h> 00019 #include <vlutil/vlFilename.h> 00020 #include <iosfwd> 00021 00025 class DT_DLL_RTIUTIL DtBaseConfig 00026 { 00027 public: 00028 00033 DtBaseConfig( const MAKRti::DtFilename& xmlFile ); 00034 00036 virtual ~DtBaseConfig(); 00037 00039 virtual void writeToFile(); 00040 00042 virtual void writeToFile( const MAKRti::DtFilename& xmlFile ); 00043 00046 virtual bool getFileVersion( MAKRti::DtString& version ) const; 00047 00049 virtual bool isFileVersionOld() const; 00050 00052 virtual void needsUpdate(); 00053 00055 virtual std::ostream& print( std::ostream& ostr ) const; 00056 00057 private: 00058 00060 DtBaseConfig( const DtBaseConfig& ); 00061 DtBaseConfig& operator=( const DtBaseConfig& ); 00062 00063 protected: 00064 00066 virtual void setDefaultConfig() = 0; 00067 00071 MAKRti::DtEnvValueSP setParam( const MAKRti::DtString& name, const MAKRti::DtString& val, 00072 const MAKRti::DtString& comment = MAKRti::DtString::nullString() ); 00073 00075 MAKRti::DtEnvValueSP getParam( const MAKRti::DtString& name ); 00076 00077 protected: 00078 00080 MAKRti::DtEnvironment myEnvironment; 00081 00085 std::auto_ptr< MAKRti::DtEnvXMLWriter > myXmlWriter; 00086 00088 MAKRti::DtFilename myXmlFile; 00089 00092 bool myUpdatedSinceWrite; 00093 00095 MAKRti::DtString myReadFileVersion; 00096 00098 bool myFileWasRead; 00099 00100 }; 00101 00102 inline std::ostream& operator<<( std::ostream& ostr, const DtBaseConfig& config ) 00103 { 00104 return config.print( ostr ); 00105 } 00106 00107 #endif // DtBaseConfig_H_