VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extendedAttributesInitializer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include <vlutil/vlString.h>
11 #include <vlutil/vlSmartPointers.h>
12 #include <vlutil/vlTime.h>
13 #include <vl/fom.h>
14 #include <boost/shared_ptr.hpp>
15 
16 #if DtHLA
17 #include <tbb/spin_mutex.h>
18 #endif
19 
20 class DtExerciseConn;
21 class DtObjClassDesc;
22 
23 #if DtHLA
24 typedef std::map<DtString, RTI::AttributeHandle> DtAttributeNameToHandleMap;
25 typedef boost::shared_ptr<DtAttributeNameToHandleMap> DtAttributeNameToHandleMapPtr;
26 typedef std::map<RTI::ObjectClassHandle, DtAttributeNameToHandleMapPtr> DtClassAttributeNameToHandleMap;
27 #endif
28 
33 {
34  public:
35 
38 
41 
44  virtual void initialize(DtExerciseConn* exConn);
45 
46 #if DtHLA
47  virtual void setObjectClassChooser(DtObjectClassChooserPtr chooser);
50 
54  virtual void addSupportedClass(const DtString& fullClassName, bool addSubclasses = false);
55 
58  virtual DtAttributeNameToHandleMapPtr attributeNameToHandleMap(
59  const RTI::ObjectClassHandle& classHdl) const;
60 
62  virtual void setAttributeNameToHandleMap(const RTI::ObjectClassHandle& classHdl,
63  const DtAttributeNameToHandleMap& mapping);
64 
65  static tbb::spin_mutex& GlobalHLAMutex()
66  {
67  return theGlobalHLAMutex;
68  }
69 #endif
70 
71 protected:
72 
77 
80  virtual bool needsInitialization(DtExerciseConn* exConn);
81 
82 #if DtHLA
83  virtual const DtString& publisherName() const = 0;
85 
87  virtual const DtString& reflectedListName() const = 0;
88 
90  virtual const DtString& defaultBaseObjectClass() const = 0;
91 
95  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc) = 0;
96 #endif
97 
100  virtual void setPublisherStateRepCreator() = 0;
101 
104  virtual void setReflectedObjectStateRepCreator() = 0;
105 
107 
108 #if DtHLA
109 
115  virtual bool areClassNamesEquivalent(const DtString&, const DtString&) const;
116 
119  virtual void addSupportedSubclasses(DtExerciseConn* exConn);
120 
122  virtual void initializeObjectClassChooser(DtExerciseConn* exConn);
123 
126  virtual void initializeObjectClasses(DtExerciseConn* exConn);
127 
130  virtual void initializeAttributes(DtObjClassDesc* desc);
131 
134  virtual void initializeExtendedAttributes(DtExerciseConn* exConn);
136 
137 #else
138 
140  virtual void initializeVariableRecordFactory(DtExerciseConn* exConn);
141 
142 #endif
143 
145 #if DtHLA
147  std::list<DtString> myFullBaseClassNames;
148  std::list<DtString> myFullClassNames;
149  static tbb::spin_mutex theGlobalHLAMutex;
151 
155 #endif
156 };
157 
158 typedef DtBoost::shared_ptr<DtExtendedAttributesInitializer> DtExtendedAttributesInitializerPtr;
159 
162 {
163 public:
164 
167 
170 
171 protected:
172 
174  virtual bool needsInitialization(DtExerciseConn* exConn);
175 
176 #if DtHLA
177  virtual const DtString& publisherName() const;
179 
181  virtual const DtString& reflectedListName() const;
182 
184  virtual const DtString& defaultBaseObjectClass() const;
185 
189  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc);
190 #endif
191 
194  virtual void setPublisherStateRepCreator();
195 
198  virtual void setReflectedObjectStateRepCreator();
199 
200 protected:
201 
203  static bool theExConnNeedsInit;
204 
205 };
206 
209 {
210 public:
211 
214 
217 
218 protected:
219 
221  virtual bool needsInitialization(DtExerciseConn* exConn);
222 
223 #if DtHLA
224  virtual const DtString& publisherName() const;
226 
228  virtual const DtString& reflectedListName() const;
229 
231  virtual const DtString& defaultBaseObjectClass() const;
232 
236  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc);
237 #endif
238 
241  virtual void setPublisherStateRepCreator();
242 
245  virtual void setReflectedObjectStateRepCreator();
246 
247 protected:
248 
250  static bool theExConnNeedsInit;
251 
252 };
253 
256 {
257 public:
258 
261 
264 
265 protected:
266 
268  virtual bool needsInitialization(DtExerciseConn* exConn);
269 
270 #if DtHLA
271  virtual const DtString& publisherName() const;
273 
275  virtual const DtString& reflectedListName() const;
276 
278  virtual const DtString& defaultBaseObjectClass() const;
279 
283  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc);
284 #endif
285 
288  virtual void setPublisherStateRepCreator();
289 
292  virtual void setReflectedObjectStateRepCreator();
293 
294 protected:
295 
297  static bool theExConnNeedsInit;
298 
299 };
300 
static tbb::spin_mutex theGlobalHLAMutex
Definition: extendedAttributesInitializer.h:149
std::map< DtString, RTI::AttributeHandle > DtAttributeNameToHandleMap
Definition: extendedAttributesInitializer.h:21
The extended attributes initializer for entity objects.
Definition: extendedAttributesInitializer.h:161
virtual void setReflectedObjectStateRepCreator()=0
Sets the state rep creator for the associated reflected object. Specific to a particular reflected ob...
std::list< DtString > myFullClassNames
Definition: extendedAttributesInitializer.h:148
std::map< RTI::ObjectClassHandle, DtAttributeNameToHandleMapPtr > DtClassAttributeNameToHandleMap
Definition: extendedAttributesInitializer.h:26
bool myNeedsInitialization
Definition: extendedAttributesInitializer.h:144
virtual void setUnknownAttributeFunctions(DtObjClassDesc *desc)=0
Sets the unknown attribute checker, encoder, and decoder functions in order to process them as extend...
DtObjectClassChooserPtr myObjectClassChooser
Definition: extendedAttributesInitializer.h:146
static DtString theExtendedAttributesClassName
Definition: extendedAttributesInitializer.h:150
The extended attributes initializer for control objects.
Definition: extendedAttributesInitializer.h:255
virtual bool needsInitialization(DtExerciseConn *exConn)
These functions are called within initialize(). Must be implemented in subclasses as they are specifi...
static bool theExConnNeedsInit
Definition: extendedAttributesInitializer.h:203
virtual const DtString & defaultBaseObjectClass() const =0
The base object class that is supported by default. All subclasses will also be supported.
virtual const DtString & publisherName() const =0
The name of the publisher class in VR-Link.
static DtTime thePrevExConnInitTime
Definition: extendedAttributesInitializer.h:296
DtClassAttributeNameToHandleMap myAttributeHandlesByName
A map of attribute handles by name for each object class supported by this repository. This is static since it can be shared by all state repositories of this type.
Definition: extendedAttributesInitializer.h:154
static DtTime thePrevExConnInitTime
Definition: extendedAttributesInitializer.h:202
static DtTime thePrevExConnInitTime
Definition: extendedAttributesInitializer.h:249
boost::shared_ptr< DtAttributeNameToHandleMap > DtAttributeNameToHandleMapPtr
Definition: extendedAttributesInitializer.h:25
virtual void setPublisherStateRepCreator()=0
Sets the state rep creator for the associated publisher. Specific to a particular publisher class and...
DtBoost::shared_ptr< DtExtendedAttributesInitializer > DtExtendedAttributesInitializerPtr
Definition: extendedAttributesInitializer.h:158
static bool theExConnNeedsInit
Definition: extendedAttributesInitializer.h:297
The extended attributes initializer for aggregate objects.
Definition: extendedAttributesInitializer.h:208
static tbb::spin_mutex & GlobalHLAMutex()
Definition: extendedAttributesInitializer.h:65
virtual const DtString & reflectedListName() const =0
The name of the reflected list class in VR-Link.
DtExtendedAttributesInitializer performs all initialization required to register publishers, reflected lists, state repositories, encoders, and decoders for a set of object classes that should support extended attributes.
Definition: extendedAttributesInitializer.h:32
static bool theExConnNeedsInit
Definition: extendedAttributesInitializer.h:250
DtBoost::shared_ptr< DtObjectClassChooser > DtObjectClassChooserPtr
Definition: vrfObjectClassChooser.h:46
#define DT_DLL_vrfExtObjects
Definition: dllExport.h:23
std::list< DtString > myFullBaseClassNames
Definition: extendedAttributesInitializer.h:147

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)