MAK RTIspy API Documentation for HLA 4
 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 "internalTypes.h"
17 #include <mtl/environment.h>
18 #include <mtl/envXmlWriter.h>
19 #include <vlutil/vlString.h>
20 #include <vlutil/vlFilename.h>
21 #include <iosfwd>
22 #include <set>
23 
27 
29 {
30 public:
35  DtRtiChooserCache( const MAKRti::DtFilename& xmlFile = MAKRti::DtFilename::nullFilename() );
36 
38  virtual ~DtRtiChooserCache();
39 
41  virtual void writeToFile();
42 
44  virtual void writeToFile( const MAKRti::DtFilename& xmlFile );
45 
47  virtual std::ostream& print( std::ostream& ostr ) const;
48 
49 
51  {
53  : myPathOfInstalledRTI("")
54  , myUseDefaultRidFile(true)
55  , myRidToUseWithInstalledRTI("")
56  , myVersion("")
57  { }
58  DtInstalledRTIInformation(MAKRti::DtString pathToRTI,
59  bool defaultRid, MAKRti::DtString ridToUse, MAKRti::DtString version )
60  : myPathOfInstalledRTI(pathToRTI)
61  , myUseDefaultRidFile(defaultRid)
62  , myRidToUseWithInstalledRTI(ridToUse)
63  , myVersion(version)
64  { }
66  : myPathOfInstalledRTI(copy.myPathOfInstalledRTI)
67  , myUseDefaultRidFile(copy.myUseDefaultRidFile)
68  , myRidToUseWithInstalledRTI(copy.myRidToUseWithInstalledRTI)
69  , myVersion(copy.myVersion) { }
70 
71  bool operator==(const DtInstalledRTIInformation& comp) const
72  {
73  bool retVal = (myPathOfInstalledRTI == comp.myPathOfInstalledRTI &&
74  myUseDefaultRidFile == comp.myUseDefaultRidFile );
75  if ( !myUseDefaultRidFile )
76  {
77  retVal &= (myRidToUseWithInstalledRTI == comp.myRidToUseWithInstalledRTI);
78  }
79  return retVal;
80  }
81  bool operator<(const DtInstalledRTIInformation& comp) const
82  {
83  if ( myPathOfInstalledRTI == comp.myPathOfInstalledRTI )
84  {
85  return myRidToUseWithInstalledRTI < comp.myRidToUseWithInstalledRTI;
86  }
87  else return ( myPathOfInstalledRTI < comp.myPathOfInstalledRTI );
88  }
89 
90  MAKRti::DtString myPathOfInstalledRTI;
92  MAKRti::DtString myRidToUseWithInstalledRTI;
93  MAKRti::DtString myVersion;
94 
95  };
96 
97 
98 
99 
100 
102  virtual void getMAK_RTIDIRs( std::set<DtInstalledRTIInformation>& installedRTIs );
103 
105  virtual bool getMAK_RTIDIR( DtInstalledRTIInformation info );
109 
111  virtual void addMAK_RTIDIR( const DtInstalledRTIInformation& installed );
112  virtual void addMAK_RTIDIRs( const std::set<DtInstalledRTIInformation>& installed );
113 
115  virtual void clearMAK_RTIDIRs();
116 
117 private:
118 
119 
121  virtual MAKRti::DtString stringifyInfoContents( const DtInstalledRTIInformation& info ) const;
122 
125  DtRtiChooserCache& operator=( const DtRtiChooserCache& );
126 
127 protected:
128 
131  bool parseFile( const MAKRti::DtFilename& filename );
132 
133 protected:
134 
136  MAKRti::DtEnvironment myEnvironment;
137 
138  static const MAKRti::DtString rtiPathString;
139  static const MAKRti::DtString ridPathString;
140  static const MAKRti::DtString defaultRidString;
141  static const MAKRti::DtString versionString;
142 
146  DtUniquePtr< MAKRti::DtEnvXMLWriter > myXmlWriter;
147 
149  MAKRti::DtFilename myXmlFile;
150 
154 };
155 
156 inline std::ostream& operator<<( std::ostream& ostr, const DtRtiChooserCache& cache )
157 {
158  return cache.print( ostr );
159 }
160 
161 #endif // DtRtiChooserCache_H_
Definition: rtiChooserCache.h:50
MAKRti::DtEnvironment myEnvironment
The cached rtiChooser environment.
Definition: rtiChooserCache.h:136
DtInstalledRTIInformation(const DtInstalledRTIInformation &copy)
Definition: rtiChooserCache.h:65
static const MAKRti::DtString defaultRidString
Definition: rtiChooserCache.h:140
static const MAKRti::DtString rtiPathString
Definition: rtiChooserCache.h:138
MAKRti::DtString myRidToUseWithInstalledRTI
Definition: rtiChooserCache.h:92
bool myUseDefaultRidFile
Definition: rtiChooserCache.h:91
static const MAKRti::DtString versionString
Definition: rtiChooserCache.h:141
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:28
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:81
MAKRti::DtFilename myXmlFile
The name of the default XML file to read from and write to.
Definition: rtiChooserCache.h:149
DtInstalledRTIInformation()
Definition: rtiChooserCache.h:52
bool myUpdatedSinceWrite
Flag indicating if the environment has changed since the last time it was written to the default file...
Definition: rtiChooserCache.h:153
MAKRti::DtString myPathOfInstalledRTI
Definition: rtiChooserCache.h:90
DtUniquePtr< MAKRti::DtEnvXMLWriter > myXmlWriter
Document writer - used to convert the document to XML in memory or file myXmlWriter is persistent so ...
Definition: rtiChooserCache.h:146
DtInstalledRTIInformation(MAKRti::DtString pathToRTI, bool defaultRid, MAKRti::DtString ridToUse, MAKRti::DtString version)
Definition: rtiChooserCache.h:58
static const MAKRti::DtString ridPathString
Definition: rtiChooserCache.h:139
MAKRti::DtString myVersion
Definition: rtiChooserCache.h:93
The declaration of internal types.
bool operator==(const DtInstalledRTIInformation &comp) const
Definition: rtiChooserCache.h:71
#define DT_DLL_RTIUTIL
Definition: rtiMsConfig.h:160

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)