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 
15 #if DtHLA
16 #include <tbb/spin_mutex.h>
17 #endif
18 
19 class DtExerciseConn;
20 class DtObjClassDesc;
21 
22 #if DtHLA
23 typedef std::map<DtString, RTI::AttributeHandle> DtAttributeNameToHandleMap;
24 typedef std::shared_ptr<DtAttributeNameToHandleMap> DtAttributeNameToHandleMapPtr;
25 typedef std::map<RTI::ObjectClassHandle, DtAttributeNameToHandleMapPtr> DtClassAttributeNameToHandleMap;
26 #endif
27 
32 {
33  public:
34 
37 
40 
43  virtual void initialize(DtExerciseConn* exConn);
44 
45 #if DtHLA
46  virtual void setObjectClassChooser(DtObjectClassChooserPtr chooser);
49 
53  virtual void addSupportedClass(const DtString& fullClassName, bool addSubclasses = false);
54 
57  virtual DtAttributeNameToHandleMapPtr attributeNameToHandleMap(
58  const RTI::ObjectClassHandle& classHdl) const;
59 
61  virtual void setAttributeNameToHandleMap(const RTI::ObjectClassHandle& classHdl,
62  const DtAttributeNameToHandleMap& mapping);
63 
64  static tbb::spin_mutex& GlobalHLAMutex()
65  {
66  return theGlobalHLAMutex;
67  }
68 #endif
69 
70 protected:
71 
76 
79  virtual bool needsInitialization(DtExerciseConn* exConn);
80 
81 #if DtHLA
82  virtual const DtString& publisherName() const = 0;
84 
86  virtual const DtString& reflectedListName() const = 0;
87 
89  virtual const DtString& defaultBaseObjectClass() const = 0;
90 
94  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc) = 0;
95 #endif
96 
99  virtual void setPublisherStateRepCreator() = 0;
100 
103  virtual void setReflectedObjectStateRepCreator() = 0;
104 
106 
107 #if DtHLA
108 
114  virtual bool areClassNamesEquivalent(const DtString&, const DtString&) const;
115 
118  virtual void addSupportedSubclasses(DtExerciseConn* exConn);
119 
121  virtual void initializeObjectClassChooser(DtExerciseConn* exConn);
122 
125  virtual void initializeObjectClasses(DtExerciseConn* exConn);
126 
129  virtual void initializeAttributes(DtObjClassDesc* desc);
130 
133  virtual void initializeExtendedAttributes(DtExerciseConn* exConn);
135 
136 #else
137 
139  virtual void initializeVariableRecordFactory(DtExerciseConn* exConn);
140 
141 #endif
142 
144 #if DtHLA
146  std::list<DtString> myFullBaseClassNames;
147  std::list<DtString> myFullClassNames;
148  static tbb::spin_mutex theGlobalHLAMutex;
150 
154 #endif
155 };
156 
157 typedef std::shared_ptr<DtExtendedAttributesInitializer> DtExtendedAttributesInitializerPtr;
158 
161 {
162 public:
163 
166 
169 
170 protected:
171 
173  virtual bool needsInitialization(DtExerciseConn* exConn);
174 
175 #if DtHLA
176  virtual const DtString& publisherName() const;
178 
180  virtual const DtString& reflectedListName() const;
181 
183  virtual const DtString& defaultBaseObjectClass() const;
184 
188  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc);
189 #endif
190 
193  virtual void setPublisherStateRepCreator();
194 
197  virtual void setReflectedObjectStateRepCreator();
198 
199 protected:
200 
202  static bool theExConnNeedsInit;
203 
204 };
205 
208 {
209 public:
210 
213 
216 
217 protected:
218 
220  virtual bool needsInitialization(DtExerciseConn* exConn);
221 
222 #if DtHLA
223  virtual const DtString& publisherName() const;
225 
227  virtual const DtString& reflectedListName() const;
228 
230  virtual const DtString& defaultBaseObjectClass() const;
231 
235  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc);
236 #endif
237 
240  virtual void setPublisherStateRepCreator();
241 
244  virtual void setReflectedObjectStateRepCreator();
245 
246 protected:
247 
249  static bool theExConnNeedsInit;
250 
251 };
252 
255 {
256 public:
257 
260 
263 
264 protected:
265 
267  virtual bool needsInitialization(DtExerciseConn* exConn);
268 
269 #if DtHLA
270  virtual const DtString& publisherName() const;
272 
274  virtual const DtString& reflectedListName() const;
275 
277  virtual const DtString& defaultBaseObjectClass() const;
278 
282  virtual void setUnknownAttributeFunctions(DtObjClassDesc* desc);
283 #endif
284 
287  virtual void setPublisherStateRepCreator();
288 
291  virtual void setReflectedObjectStateRepCreator();
292 
293 protected:
294 
296  static bool theExConnNeedsInit;
297 
298 };
299 
static tbb::spin_mutex theGlobalHLAMutex
Definition: extendedAttributesInitializer.h:148
std::map< DtString, RTI::AttributeHandle > DtAttributeNameToHandleMap
Definition: extendedAttributesInitializer.h:20
The extended attributes initializer for entity objects.
Definition: extendedAttributesInitializer.h:160
virtual void setReflectedObjectStateRepCreator()=0
Sets the state rep creator for the associated reflected object. Specific to a particular reflected ob...
std::shared_ptr< DtAttributeNameToHandleMap > DtAttributeNameToHandleMapPtr
Definition: extendedAttributesInitializer.h:24
std::list< DtString > myFullClassNames
Definition: extendedAttributesInitializer.h:147
std::map< RTI::ObjectClassHandle, DtAttributeNameToHandleMapPtr > DtClassAttributeNameToHandleMap
Definition: extendedAttributesInitializer.h:25
bool myNeedsInitialization
Definition: extendedAttributesInitializer.h:143
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:145
static DtString theExtendedAttributesClassName
Definition: extendedAttributesInitializer.h:149
The extended attributes initializer for control objects.
Definition: extendedAttributesInitializer.h:254
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:202
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:295
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:153
static DtTime thePrevExConnInitTime
Definition: extendedAttributesInitializer.h:201
static DtTime thePrevExConnInitTime
Definition: extendedAttributesInitializer.h:248
virtual void setPublisherStateRepCreator()=0
Sets the state rep creator for the associated publisher. Specific to a particular publisher class and...
static bool theExConnNeedsInit
Definition: extendedAttributesInitializer.h:296
std::shared_ptr< DtExtendedAttributesInitializer > DtExtendedAttributesInitializerPtr
Definition: extendedAttributesInitializer.h:157
The extended attributes initializer for aggregate objects.
Definition: extendedAttributesInitializer.h:207
static tbb::spin_mutex & GlobalHLAMutex()
Definition: extendedAttributesInitializer.h:64
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:31
static bool theExConnNeedsInit
Definition: extendedAttributesInitializer.h:249
DtBoost::shared_ptr< DtObjectClassChooser > DtObjectClassChooserPtr
Definition: vrfObjectClassChooser.h:46
#define DT_DLL_vrfExtObjects
Definition: dllExport.h:23
std::list< DtString > myFullBaseClassNames
Definition: extendedAttributesInitializer.h:146

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)