VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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(AggregateTypeMap) \
38  X(DetonationTypeMap) \
39  X(TacticalGraphicsMap) \
40  X(RadioCommunicationsMap) \
41  X(RadioTransmissionsMap) \
42  X(TacticalSmokeMap) \
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 
145 
148  DtEntityTypeMapper& typeMapper( MapperType type );
149 
152  const DtEntityTypeMapper& typeMapper( MapperType type ) const;
153 
156  DtEntityTypeMapper& entityTypeMapper();
157 
160  const DtEntityTypeMapper& entityTypeMapper() const;
161 
164  DtEntityTypeMapper& aggregateTypeMapper();
165 
168  const DtEntityTypeMapper& aggregateTypeMapper() const;
169 
172  DtEntityTypeMapper& weaponFireMapper();
173 
176  const DtEntityTypeMapper& weaponFireMapper() const;
177 
180  DtEntityTypeMapper& detonationTypeMapper();
181 
184  const DtEntityTypeMapper& detonationTypeMapper() const;
185 
188  DtEntityTypeMapper& tacticalGraphicsMapper();
189 
192  const DtEntityTypeMapper& tacticalGraphicsMapper() const;
193 
196  DtEntityTypeMapper& radioCommunicationMapper();
197 
200  const DtEntityTypeMapper& radioCommunicationMapper() const;
201 
204  DtEntityTypeMapper& radioTransmissionMapper();
205 
208  const DtEntityTypeMapper& radioTransmissionMapper() const;
209 
212  DtEntityTypeMapper& tacticalSmokeMapper();
213 
216  const DtEntityTypeMapper& tacticalSmokeMapper() const;
217 
219 
221  static std::string className();
222 
223  protected:
224 
229 
232 
236  virtual void connectMapper( DtEntityTypeMapper& mapper );
237 
239  virtual void disconnectMapper( DtEntityTypeMapper& mapper );
240 
243  virtual void mapperChanged( const DtEntityType& type,
244  const DtUnicode& value, DtEntityTypeMapper& mapper );
245 
246  private:
247 
250  void initializeMapper( MapperType mapperType,
251  const std::string& backupName );
252 
253  protected:
254 
256  std::vector<DtUnicode> myEmptyMappings;
257 
258  static char* theMapperNames[];
259 
260  typedef boost::unordered_map<MapperType,DtEntityTypeMapper*> MappersMap;
261 
263 
264  };
265 
266 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)