MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rtiChooserCache.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2008 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: rtiChooserCache.h,v $ $Revision: 1.1 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DtRtiChooserCache_H_
13 #define DtRtiChooserCache_H_
14 
15 #include <rtiMsConfig.h>
16 #include <mtl/environment.h>
17 #include <mtl/envXmlWriter.h>
18 #include <vlutil/vlString.h>
19 #include <vlutil/vlFilename.h>
20 #include <iosfwd>
21 #include <set>
22 
26 
28 {
29 public:
34  DtRtiChooserCache( const MAKRti::DtFilename& xmlFile = MAKRti::DtFilename::nullFilename() );
35 
37  virtual ~DtRtiChooserCache();
38 
40  virtual void writeToFile();
41 
43  virtual void writeToFile( const MAKRti::DtFilename& xmlFile );
44 
46  virtual std::ostream& print( std::ostream& ostr ) const;
47 
48 
50  {
52  : myPathOfInstalledRTI("")
53  , myUseDefaultRidFile(true)
54  , myRidToUseWithInstalledRTI("")
55  , myVersion("")
56  { }
57  DtInstalledRTIInformation(MAKRti::DtString pathToRTI,
58  bool defaultRid, MAKRti::DtString ridToUse, MAKRti::DtString version )
59  : myPathOfInstalledRTI(pathToRTI)
60  , myUseDefaultRidFile(defaultRid)
61  , myRidToUseWithInstalledRTI(ridToUse)
62  , myVersion(version)
63  { }
65  : myPathOfInstalledRTI(copy.myPathOfInstalledRTI)
66  , myUseDefaultRidFile(copy.myUseDefaultRidFile)
67  , myRidToUseWithInstalledRTI(copy.myRidToUseWithInstalledRTI)
68  , myVersion(copy.myVersion) { }
69 
70  bool operator==(const DtInstalledRTIInformation& comp) const
71  {
72  bool retVal = (myPathOfInstalledRTI == comp.myPathOfInstalledRTI &&
73  myUseDefaultRidFile == comp.myUseDefaultRidFile );
74  if ( !myUseDefaultRidFile )
75  {
76  retVal &= (myRidToUseWithInstalledRTI == comp.myRidToUseWithInstalledRTI);
77  }
78  return retVal;
79  }
80  bool operator<(const DtInstalledRTIInformation& comp) const
81  {
82  if ( myPathOfInstalledRTI == comp.myPathOfInstalledRTI )
83  {
84  return myRidToUseWithInstalledRTI < comp.myRidToUseWithInstalledRTI;
85  }
86  else return ( myPathOfInstalledRTI < comp.myPathOfInstalledRTI );
87  }
88 
89  MAKRti::DtString myPathOfInstalledRTI;
91  MAKRti::DtString myRidToUseWithInstalledRTI;
92  MAKRti::DtString myVersion;
93 
94  };
95 
96 
97 
98 
99 
101  virtual void getMAK_RTIDIRs( std::set<DtInstalledRTIInformation>& installedRTIs );
102 
104  virtual bool getMAK_RTIDIR( DtInstalledRTIInformation info );
108 
110  virtual void addMAK_RTIDIR( const DtInstalledRTIInformation& installed );
111  virtual void addMAK_RTIDIRs( const std::set<DtInstalledRTIInformation>& installed );
112 
114  virtual void clearMAK_RTIDIRs();
115 
116 private:
117 
118 
120  virtual MAKRti::DtString stringifyInfoContents( const DtInstalledRTIInformation& info ) const;
121 
124  DtRtiChooserCache& operator=( const DtRtiChooserCache& );
125 
126 protected:
127 
130  bool parseFile( const MAKRti::DtFilename& filename );
131 
132 protected:
133 
135  MAKRti::DtEnvironment myEnvironment;
136 
137  static const MAKRti::DtString rtiPathString;
138  static const MAKRti::DtString ridPathString;
139  static const MAKRti::DtString defaultRidString;
140  static const MAKRti::DtString versionString;
141 
145  std::auto_ptr< MAKRti::DtEnvXMLWriter > myXmlWriter;
146 
148  MAKRti::DtFilename myXmlFile;
149 
153 };
154 
155 inline std::ostream& operator<<( std::ostream& ostr, const DtRtiChooserCache& cache )
156 {
157  return cache.print( ostr );
158 }
159 
160 #endif // DtRtiChooserCache_H_
Definition: rtiChooserCache.h:49
MAKRti::DtEnvironment myEnvironment
The cached rtiChooser environment.
Definition: rtiChooserCache.h:135
DtInstalledRTIInformation(const DtInstalledRTIInformation &copy)
Definition: rtiChooserCache.h:64
static const MAKRti::DtString defaultRidString
Definition: rtiChooserCache.h:139
static const MAKRti::DtString rtiPathString
Definition: rtiChooserCache.h:137
MAKRti::DtString myRidToUseWithInstalledRTI
Definition: rtiChooserCache.h:91
bool myUseDefaultRidFile
Definition: rtiChooserCache.h:90
std::auto_ptr< MAKRti::DtEnvXMLWriter > myXmlWriter
Document writer - used to convert the document to XML in memory or file myXmlWriter is persistent so ...
Definition: rtiChooserCache.h:145
static const MAKRti::DtString versionString
Definition: rtiChooserCache.h:140
std::ostream & operator<<(std::ostream &ostr, const DtAssistantConfig &config)
Definition: assistantConfig.h:85
Stores the cached MAK_RTIDIR&#39;s that a user has selected through the rtiChooser.
Definition: rtiChooserCache.h:27
virtual std::ostream & print(std::ostream &ostr) const
Prints the cache to the given output stream.
bool operator<(const DtInstalledRTIInformation &comp) const
Definition: rtiChooserCache.h:80
MAKRti::DtFilename myXmlFile
The name of the default XML file to read from and write to.
Definition: rtiChooserCache.h:148
DtInstalledRTIInformation()
Definition: rtiChooserCache.h:51
bool myUpdatedSinceWrite
Flag indicating if the environment has changed since the last time it was written to the default file...
Definition: rtiChooserCache.h:152
MAKRti::DtString myPathOfInstalledRTI
Definition: rtiChooserCache.h:89
DtInstalledRTIInformation(MAKRti::DtString pathToRTI, bool defaultRid, MAKRti::DtString ridToUse, MAKRti::DtString version)
Definition: rtiChooserCache.h:57
static const MAKRti::DtString ridPathString
Definition: rtiChooserCache.h:138
MAKRti::DtString myVersion
Definition: rtiChooserCache.h:92
bool operator==(const DtInstalledRTIInformation &comp) const
Definition: rtiChooserCache.h:70
#define DT_DLL_RTIUTIL
Definition: rtiMsConfig.h:127

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)