VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSharedSimulationSettings.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2012 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvVrl/vrvVrl.h>
14 #include <boost/unordered_map.hpp>
15 #include <vrvUtil/DtUnicode.h>
16 #include <vector>
17 
18 class DtEntityType;
19 
20 namespace makVrv
21 {
22 
23  class DtEntityTypeMapper;
24  class DtSharedSimulationSettings;
25 
29  {
30  public:
31 
32  // X Macro for entity mapper types.
33  // http://www.drdobbs.com/blogs/cpp/228700289
34 #define SIMSETTINGSMAPPERS \
35  X(FireTypeMap) \
36  X(EntityTypeMap) \
37  X(UnitTypeMap) \
38  X(DetonationTypeMap) \
39  X(TacticalGraphicsTypeMap) \
40  X(RadioCommunicationsTypeMap) \
41  X(RadioTransmissionsTypeMap) \
42  X(SmokeTypeMap) \
43  X(NumSimSettingsMappers)
44 
45  // X macro definition and enum declaration.
46 #define X(a) Sim##a,
48 #undef X
49 
50  public:
51 
53  virtual ~DtSharedSimulationSettings();
54 
56  virtual void setMapper( MapperType mapperType,
57  const DtEntityTypeMapper& mapper );
58 
61 
63  void setMapping( MapperType mapperType, const DtEntityType& type, const DtUnicode& definition );
64 
66  void setEntityModelMapping( const DtEntityType& type, const DtUnicode& definition );
67 
69  void setAggregateModelMapping( const DtEntityType& type, const DtUnicode& definition );
70 
72  void setTacticalGraphicsMapping( const DtEntityType& type, const DtUnicode& definition );
73 
75  void setFireModelMapping( const DtEntityType& type, const DtUnicode& definition );
76 
78  void setDetonationModelMapping( const DtEntityType& type, const DtUnicode& definition );
79 
81  void setRadioCommunicationsMapping( const DtEntityType& type, const DtUnicode& definition );
82 
84  void setRadioTransmissionsMapping( const DtEntityType& type, const DtUnicode& definition );
85 
87  void setTacticalSmokeMapping( const DtEntityType& type, const DtUnicode& definition );
88 
90 
93 
96  const std::vector<DtUnicode>& mapDefinition( MapperType mapperType, const DtEntityType& type ) const;
97 
100  const std::vector<DtUnicode>& mapEntityDefinition( const DtEntityType& type ) const;
101 
104  const std::vector<DtUnicode>& mapAggregateDefinition( const DtEntityType& type ) const;
105 
108  const std::vector<DtUnicode>& mapFireTypeDefinition( const DtEntityType& type ) const;
109 
112  const std::vector<DtUnicode>& mapDetonationDefinition( const DtEntityType& type ) const;
113 
116  const std::vector<DtUnicode>& mapTacticalGraphicsDefinition( const DtEntityType& type ) const;
117 
120  const std::vector<DtUnicode>& mapRadioCommunicationDefinition( const DtEntityType& type ) const;
121 
124  const std::vector<DtUnicode>& mapRadioTransmissionDefinition( const DtEntityType& type ) const;
125 
128  const std::vector<DtUnicode>& mapTacticalSmokeDefinition( const DtEntityType& type ) const;
129 
131 
134 
136  DtEntityTypeMapper* findMapperByName( const std::string& name );
137 
139  const DtEntityTypeMapper* findMapperByName( const std::string& name ) const;
140 
142  virtual void mapperNames(std::vector<std::string>& names) const;
143 
145 
148 
151  DtEntityTypeMapper& typeMapper( MapperType type );
152 
155  const DtEntityTypeMapper& typeMapper( MapperType type ) const;
156 
159  DtEntityTypeMapper& entityTypeMapper();
160 
163  const DtEntityTypeMapper& entityTypeMapper() const;
164 
167  DtEntityTypeMapper& aggregateTypeMapper();
168 
171  const DtEntityTypeMapper& aggregateTypeMapper() const;
172 
175  DtEntityTypeMapper& weaponFireMapper();
176 
179  const DtEntityTypeMapper& weaponFireMapper() const;
180 
183  DtEntityTypeMapper& detonationTypeMapper();
184 
187  const DtEntityTypeMapper& detonationTypeMapper() const;
188 
191  DtEntityTypeMapper& tacticalGraphicsMapper();
192 
195  const DtEntityTypeMapper& tacticalGraphicsMapper() const;
196 
199  DtEntityTypeMapper& radioCommunicationMapper();
200 
203  const DtEntityTypeMapper& radioCommunicationMapper() const;
204 
207  DtEntityTypeMapper& radioTransmissionMapper();
208 
211  const DtEntityTypeMapper& radioTransmissionMapper() const;
212 
215  DtEntityTypeMapper& tacticalSmokeMapper();
216 
219  const DtEntityTypeMapper& tacticalSmokeMapper() const;
220 
222 
224  static const std::string& className();
225 
226  protected:
227 
232 
235 
239  virtual void connectMapper( DtEntityTypeMapper& mapper );
240 
242  virtual void disconnectMapper( DtEntityTypeMapper& mapper );
243 
246  virtual void mapperChanged( const DtEntityType& type,
247  const DtUnicode& value, DtEntityTypeMapper& mapper );
248 
249  private:
250 
253  void initializeMapper( MapperType mapperType,
254  const std::string& backupName );
255 
256  protected:
257 
259  std::vector<DtUnicode> myEmptyMappings;
260 
261  static char* theMapperNames[];
262 
263  typedef boost::unordered_map<MapperType,DtEntityTypeMapper*> MappersMap;
264 
266 
267  };
268 
269 }
a read settings lock on a setting object. The object can only get read access aka const functions...
Definition: DtReadSettingsLock.h:48
#define DT_DLL_VRVVRL
Definition: vrvVrl.h:19
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
MappersMap myMappers
Definition: DtSharedSimulationSettings.h:265
An EntityType to Definition mapper.
Definition: DtEntityTypeMapper.h:34
MapperType
Definition: DtSharedSimulationSettings.h:47
The shared settings manager, is the global object responsible for managing any shared settings object...
Definition: DtSharedSettingsManager.h:42
The base class for all shared settings. Actual settings class should have the following members/decla...
Definition: DtSharedSettings.h:45
std::vector< DtUnicode > myEmptyMappings
Empty vector, for returning the reference which will always be empty.
Definition: DtSharedSimulationSettings.h:259
Contains the DtSharedSettings class declaration.
boost::unordered_map< MapperType, DtEntityTypeMapper * > MappersMap
Definition: DtSharedSimulationSettings.h:263
The shared simulation settings.
Definition: DtSharedSimulationSettings.h:28
a write settings lock on a setting object. The object can be read and modified, but no other threads ...
Definition: DtWriteSettingsLock.h:47
#define SIMSETTINGSMAPPERS
Definition: DtSharedSimulationSettings.h:34
Contains DLL export macros.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)