VR-Forces 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) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvVrl/vrvVrl.h>
13 
15 
16 #include <vrvUtil/signalslib.h>
17 #include <vrvUtil/DtUnicode.h>
18 
19 #include <unordered_map>
20 #include <vector>
21 
22 class DtEntityType;
23 
24 namespace makVrv
25 {
26 
27  class DtEntityTypeMapper;
28  class DtSharedSimulationSettings;
29 
33  {
34  public:
35 
36  // X Macro for entity mapper types.
37  // http://www.drdobbs.com/blogs/cpp/228700289
38 #define SIMSETTINGSMAPPERS \
39  X(FireTypeMap) \
40  X(EntityTypeMap) \
41  X(UnitTypeMap) \
42  X(DetonationTypeMap) \
43  X(SoundInteractionsTypeMap) \
44  X(TacticalGraphicsTypeMap) \
45  X(RadioCommunicationsTypeMap) \
46  X(IffReplyTypeMap) \
47  X(RadioTransmissionsTypeMap) \
48  X(SmokeTypeMap) \
49  X(NumSimSettingsMappers)
50 
51  // X macro definition and enum declaration.
52 #define X(a) Sim##a,
54 #undef X
55 
56  public:
57 
59  virtual ~DtSharedSimulationSettings();
60 
62  virtual void setMapper( MapperType mapperType,
63  const DtEntityTypeMapper& mapper );
64 
67 
69  void setMapping( MapperType mapperType, const DtEntityType& type, const DtUnicode& definition );
70 
72  void setEntityModelMapping( const DtEntityType& type, const DtUnicode& definition );
73 
75  void setAggregateModelMapping( const DtEntityType& type, const DtUnicode& definition );
76 
78  void setTacticalGraphicsMapping( const DtEntityType& type, const DtUnicode& definition );
79 
81  void setFireModelMapping( const DtEntityType& type, const DtUnicode& definition );
82 
84  void setDetonationModelMapping( const DtEntityType& type, const DtUnicode& definition );
85 
87  void setSoundMapping( const DtEntityType& type, const DtUnicode& definition );
88 
90  void setRadioCommunicationsMapping( const DtEntityType& type, const DtUnicode& definition );
91 
93  void setRadioTransmissionsMapping( const DtEntityType& type, const DtUnicode& definition );
94 
96  void setTacticalSmokeMapping( const DtEntityType& type, const DtUnicode& definition );
97 
99 
102 
105  const std::vector<DtUnicode>& mapDefinition( MapperType mapperType, const DtEntityType& type ) const;
106 
109  const std::vector<DtUnicode>& mapEntityDefinition( const DtEntityType& type ) const;
110 
113  const std::vector<DtUnicode>& mapAggregateDefinition( const DtEntityType& type ) const;
114 
117  const std::vector<DtUnicode>& mapFireTypeDefinition( const DtEntityType& type ) const;
118 
121  const std::vector<DtUnicode>& mapDetonationDefinition( const DtEntityType& type ) const;
122 
125  const std::vector<DtUnicode>& mapSoundDefinition( const DtEntityType& type ) const;
126 
129  const std::vector<DtUnicode>& mapTacticalGraphicsDefinition( const DtEntityType& type ) const;
130 
133  const std::vector<DtUnicode>& mapRadioCommunicationDefinition( const DtEntityType& type ) const;
134 
137  const std::vector<DtUnicode>& mapRadioTransmissionDefinition( const DtEntityType& type ) const;
138 
141  const std::vector<DtUnicode>& mapIffReplyDefinition( const DtEntityType& type ) const;
142 
145  const std::vector<DtUnicode>& mapTacticalSmokeDefinition( const DtEntityType& type ) const;
146 
148 
151 
153  DtEntityTypeMapper* findMapperByName( const std::string& name );
154 
156  const DtEntityTypeMapper* findMapperByName( const std::string& name ) const;
157 
159  virtual void mapperNames(std::vector<std::string>& names) const;
160 
162 
165 
168  DtEntityTypeMapper& typeMapper( MapperType type );
169 
172  const DtEntityTypeMapper& typeMapper( MapperType type ) const;
173 
176  DtEntityTypeMapper& entityTypeMapper();
177 
180  const DtEntityTypeMapper& entityTypeMapper() const;
181 
184  DtEntityTypeMapper& aggregateTypeMapper();
185 
188  const DtEntityTypeMapper& aggregateTypeMapper() const;
189 
192  DtEntityTypeMapper& weaponFireMapper();
193 
196  const DtEntityTypeMapper& weaponFireMapper() const;
197 
200  DtEntityTypeMapper& detonationTypeMapper();
201 
204  const DtEntityTypeMapper& detonationTypeMapper() const;
205 
208  DtEntityTypeMapper& soundTypeMapper();
209 
212  const DtEntityTypeMapper& soundTypeMapper() const;
213 
216  DtEntityTypeMapper& tacticalGraphicsMapper();
217 
220  const DtEntityTypeMapper& tacticalGraphicsMapper() const;
221 
224  DtEntityTypeMapper& radioCommunicationMapper();
225 
228  const DtEntityTypeMapper& radioCommunicationMapper() const;
229 
232  DtEntityTypeMapper& radioTransmissionMapper();
233 
236  const DtEntityTypeMapper& radioTransmissionMapper() const;
237 
240  DtEntityTypeMapper& iffReplyMapper();
241 
244  const DtEntityTypeMapper& iffReplyMapper() const;
245 
248  DtEntityTypeMapper& tacticalSmokeMapper();
249 
252  const DtEntityTypeMapper& tacticalSmokeMapper() const;
253 
255 
257  static DtUnicode chooseElementDefinition(const std::vector<DtUnicode>& definitions);
258 
260  static const std::string& className();
261 
262  protected:
263 
268 
271 
275  virtual void connectMapper( DtEntityTypeMapper& mapper );
276 
278  virtual void disconnectMapper( DtEntityTypeMapper& mapper );
279 
282  virtual void mapperChanged( const DtEntityType& type,
283  const DtUnicode& value, DtEntityTypeMapper& mapper );
284 
285  private:
286 
289  void initializeMapper( MapperType mapperType,
290  const std::string& backupName );
291 
292  protected:
293 
295  std::vector<DtUnicode> myEmptyMappings;
296 
297  static const char* theMapperNames[];
298 
299  typedef std::unordered_map<MapperType,DtEntityTypeMapper*> MappersMap;
300 
302 
303  makVrv::vrvSignalsLib::connection myMappingAddedConnection;
304  makVrv::vrvSignalsLib::connection myMappingRemovedConnection;
305 
306  };
307 
308 }
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:301
An EntityType to Definition mapper.
Definition: DtEntityTypeMapper.h:34
MapperType
Definition: DtSharedSimulationSettings.h:53
The shared settings manager, is the global object responsible for managing any shared settings object...
Definition: DtSharedSettingsManager.h:42
makVrv::vrvSignalsLib::connection myMappingAddedConnection
Definition: DtSharedSimulationSettings.h:303
The base class for all shared settings. Actual settings class should have the following members/decla...
Definition: DtSharedSettings.h:48
std::vector< DtUnicode > myEmptyMappings
Empty vector, for returning the reference which will always be empty.
Definition: DtSharedSimulationSettings.h:295
Contains the DtSharedSettings class declaration.
The shared simulation settings.
Definition: DtSharedSimulationSettings.h:32
a write settings lock on a setting object. The object can be read and modified, but no other threads ...
Definition: DtWriteSettingsLock.h:47
std::unordered_map< MapperType, DtEntityTypeMapper * > MappersMap
Definition: DtSharedSimulationSettings.h:299
makVrv::vrvSignalsLib::connection myMappingRemovedConnection
Definition: DtSharedSimulationSettings.h:304
#define SIMSETTINGSMAPPERS
Definition: DtSharedSimulationSettings.h:38
Contains DLL export macros.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)