MAK RTIspy API Documentation for HLA 1516
fomMgr.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: fomMgr.h,v $ $Revision: 1.47 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtFomClassMgr_H_
13 #define DtFomClassMgr_H_
14 
15 #include <vlutil/vlFedTarget.h>
16 #include "attrInfo.h"
17 #include "spaceInfo.h"
18 #include "objClassInfo.h"
19 #include "intClassInfo.h"
20 #include "fedTargetHelper.h"
21 #include "attrInfo.h"
22 #include "RIDparams.h"
23 #include <set>
24 #include <map>
25 #include <mtl/xmlFedReader.h>
26 #include <vector>
27 
28 
31 
32 class DtFomClassMgr;
33 class DtAttrInfo;
34 typedef std::vector<DtAttrInfo> DtAttrVector;
35 typedef DtFomClassMgr* (*DtFomClassMgrCreator)(DtRIDParameters* p);
37 typedef std::vector<DtObjectClassInfo*> DtObjectClassVector;
38 typedef std::vector<DtInteractionClassInfo*> DtInteractionClassVector;
39 
40 
41 
42 #ifdef DDM
43 typedef std::vector<DtSpaceInfo> DtSpaceVector;
44 #endif
45 
46 class DT_DLL_LRC DtFomClassMgr : public MAKRti::DtFedTarget
47 {
48 protected:
49 
52 
54  DtFomClassMgr();
55 
57  DtFomClassMgr& operator=(const DtFomClassMgr& orig);
58 
59 public:
60 
62  DtFomClassMgr(const DtFomClassMgr& orig);
63 
65  virtual ~DtFomClassMgr();
66 
67  //-------------------------------------------------------------------------
69  //-------------------------------------------------------------------------
70 
71 
73  virtual void addSpace(const char* name);
74 
77  virtual void addDimension(const char* spaceName, const char* dimName);
78 
80  virtual void addDimension(const char* dimName, unsigned long upperBound,
81  unsigned long defaultLowerBound, unsigned long defaultUpperBound,
82  bool excluded);
83 
86  virtual bool addInteractionDimension(const char* interactionName,
87  const char* dimension);
88 
90  virtual bool addInterClass(const char* name, const char* baseName,
91  MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
92  DtSharingType sharing, const MAKRti::DtString& semantics,
93  const char* space=NULL);
94 
95  virtual bool addInterClass(const char* name, const char* baseName,
96  MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
97  const char* spaceName = NULL );
98 
99  virtual bool addObjClass( const char* name, const char* baseName,
100  DtSharingType sharing, const MAKRti::DtString& semantics );
101 
103  virtual bool addObjClass(const char* name, const char* baseName);
104 
105  virtual void addParameter(const char* className, const char* paramName );
106 
109  virtual void addParameter(const char* className,
110  const char* paramName,
111  const char* semantics );
112 
115  virtual bool addAttributeDimension(const char* className,
116  const char* attrName, const char* dimName);
117 
120  virtual void addAttribute(const char* className, const char* attrName,
121  MAKRti::DtTransportType transport, MAKRti::DtOrderType order, DtSharingType sharing,
122  DtFomUpdateType updateType, const MAKRti::DtString& updateCondition,
123  DtOwnershipType ownershipType, const MAKRti::DtString& semantics,
124  const char* spaceName=NULL );
125 
126  virtual void addAttribute(const char* className, const char* attrName,
127  MAKRti::DtTransportType transport, MAKRti::DtOrderType order, const char* spaceName=NULL );
128 
129  virtual void initUpdateRates(DtRIDParameters* params) ;
130 
131 
133  const MAKRti::DtUpdateRateSetT & getUpdateRates() const;
134 
136  float updateRateByName(const char * name);
137 
140  int positionOfRate(float rate) const;
141 
143  bool knownUpdateRate(const MAKRti::DtString& rateName) const;
144 
145 
147  virtual DtMergeFomStatus mergeObjectClasses( DtFedTarget const& module );
148 
150  virtual DtMergeFomStatus mergeObjectInfo( DtObjectClassInfo const& classInfo );
151 
153  virtual void mergeAttributes( DtObjectClassInfo const& classInfo,
154  DtFomClassMgr const& module );
155 
157  virtual DtMergeFomStatus mergeInteractionClasses( DtFedTarget const& module );
158 
160  virtual DtMergeFomStatus mergeInteractionInfo( DtInteractionClassInfo const & interInfo,
161  const char* spaceName = 0);
162 
164  virtual void mergeParameters( DtInteractionClassInfo const& interInfo );
165 
167  virtual DtMergeFomStatus mergeSpaces( DtFedTarget const& module );
168 
170  virtual DtMergeFomStatus mergeDimensions( DtSpaceInfo const& spaceInfo );
171 
173  virtual DtMergeFomStatus mergeSwitches( DtFedTarget const& module );
174 
175  //-------------------------------------------------------------------------
177  //-------------------------------------------------------------------------
178 
179  //------------------------------------------- Object classes and attributes
180 
182  virtual DtObjectClassHandle classHandle (
183  const char* theName,
184  bool throwException=true);
185 
188  virtual const char* className (
189  DtObjectClassHandle theHandle,
190  bool throwException=true);
191 
193  virtual DtAttributeHandle attrHandle (
194  const char* theName,
195  DtObjectClassHandle whichClass,
196  bool throwException=true);
197 
200  virtual const char* attrName (
201  DtAttributeHandle theHandle,
202  DtObjectClassHandle whichClass,
203  bool throwException=true);
204 
206  virtual DtObjectClassInfo* classByName(const char *name) const;
207 
209  virtual DtObjectClassInfo* classByHandle(
210  DtObjectClassHandle handle) const;
211 
213  virtual DtObjectClassInfo* objectRootClass() const;
214 
216  virtual DtObjectClassHandle objectRootHandle() const;
217 
219  virtual int numClasses() const;
220 
227  virtual void addClassHdlForUnknownClass(DtObjectClassHandle handle,
228  DtObjectClassHandle baseClassHandle);
229 
230  //------------------------------------------- Regions and spaces
231 #ifdef DDM
232 
233  virtual DtSpaceHandle spaceHandle (
234  const char* theName,
235  bool throwException=true) const;
236 
239  virtual const char* spaceName (
240  DtSpaceHandle theHandle,
241  bool throwException=true) const;
242 
244  virtual DtDimensionHandle dimHandle (
245  const char* theName,
246  DtSpaceHandle whichSpace,
247  bool throwException=true) const;
248 
251  virtual const char* dimName (
252  DtDimensionHandle theHandle,
253  DtSpaceHandle whichSpace,
254  bool throwException=true) const;
255 
257  virtual unsigned long dimUpperBound(
258  DtDimensionHandle theHandle,
259  DtSpaceHandle whichSpace,
260  bool throwException=true);
261 
263  virtual DtDimensionHandleSet const & getAvailableDimensionsForClassAttribute(
264  DtObjectClassHandle passedInClassHandle, DtAttributeHandle attrHandle);
265 
267  virtual DtDimensionHandleSet const &
268  getAvailableDimensionsForInteractionClass(
269  DtInteractionClassHandle passedInClassHandle);
270 
272  virtual DtSpaceInfo* spaceByName(const char *name);
273  virtual const DtSpaceInfo* spaceByName(const char *name) const;
274 
276  virtual DtSpaceInfo* spaceByHandle(DtSpaceHandle handle);
277  virtual const DtSpaceInfo* spaceByHandle(DtSpaceHandle handle) const;
278 
280  virtual int numSpaces() const;
281 #endif
282 
283  //------------------------------------------- Interactions and parameters
284 
286  virtual DtInteractionClassInfo* interactionByName(const char *name) const;
287 
289  virtual DtInteractionClassInfo* interactionByHandle(
290  DtInteractionClassHandle handle) const;
291 
293  virtual DtInteractionClassInfo* interactionRootClass() const;
294 
296  virtual DtInteractionClassHandle interactionRootHandle() const;
297 
299  virtual DtInteractionClassHandle interactionHandle (
300  const char* theName,
301  bool throwException=true);
302 
305  virtual const char* interactionName (
306  DtInteractionClassHandle theHandle,
307  bool throwException=true);
308 
310  virtual DtParameterHandle paramHandle (
311  const char* theName,
312  DtInteractionClassHandle whichClass,
313  bool throwException=true);
314 
317  virtual const char* paramName (
318  DtParameterHandle theHandle,
319  DtInteractionClassHandle whichClass,
320  bool throwException=true);
321 
323  virtual int numInteractions() const;
324 
331  virtual void addInteractionHdlForUnknownClass(DtInteractionClassHandle handle,
332  DtInteractionClassHandle baseClassHandle);
333 
334  //-------------------------------------------------------------------------
336  //-------------------------------------------------------------------------
337 
338  virtual void initDMFilteringParameters(const DtRIDParameters* params);
339  virtual void printDMSubscriptions();
340 
341  //-------------------------------------------------------------------------
343  //-------------------------------------------------------------------------
344 
346  virtual bool save(DtRtiSaveFile& file);
347 
349  virtual void prepareToRestore();
350 
352  virtual bool restore( DtRtiSaveFile& file );
353 
355  virtual void setExtend13and1516interop(bool enable);
356  virtual bool extend13and1516interop() const;
357 
359  virtual void print() const;
360 
362  virtual DtFomClassMgr* clone();
363 
364 
365  //-------------------------------------------------------------------------
367  //-------------------------------------------------------------------------
368 
371  virtual void setConveyRegionDesignatorSets(bool value);
372 
373 
377  // TODO make this into a method getter/setter thingie
378  unsigned long myCrc;
379 
380 public:
381 
383  static DtFomClassMgr* create(DtRIDParameters* p);
384 
388  static void setCreatorFunction(DtFomClassMgrCreator fn);
389 
390 protected:
391 
392  void init();
393 
394 #ifdef DDM
395 
396  virtual void addSpaceSorted( const char* nameValue );
397  virtual void addSpaceUnsorted( const char* nameValue );
398 #endif
399 
401  virtual DtInteractionClassInfo* addInterClassSorted( const char* name,
402  const char* baseName, MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
403  DtSpaceHandle spaceH, DtInteractionClassInfo* baseClass,
404  DtSharingType sharing,
405  const MAKRti::DtString& semantics );
406  virtual DtInteractionClassInfo* addInterClassUnsorted( const char* name,
407  const char* baseName, MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
408  DtSpaceHandle spaceH, DtInteractionClassInfo* baseClass,
409  DtSharingType sharing, const MAKRti::DtString& semantics );
410 
412  virtual DtObjectClassInfo* addObjClassSorted( const char* name,
413  const char* baseName, DtSharingType sharing,
414  const MAKRti::DtString& semantics, DtObjectClassInfo* baseClass );
415  virtual DtObjectClassInfo* addObjClassUnsorted( const char* name,
416  const char* baseName, DtSharingType sharing,
417  const MAKRti::DtString& semantics, DtObjectClassInfo* baseClass );
418 
421  virtual bool objectClassPresent(const char* name,
422  unsigned int startIndex = 0,
423  unsigned int endIndex = 0 ) const;
424 
425  virtual bool attrPresent( const char *name,
426  DtObjectClassInfo* classInfo,
427  unsigned int startIndex = 0,
428  unsigned int endIndex = 0 ) const;
429 
430  virtual bool interactionClassPresent(const char* name,
431  unsigned int startIndex = 0,
432  unsigned int endIndex = 0 ) const;
433 
435  virtual unsigned int objectClassPosition( const char* name,
436  unsigned int startIndex = 0,
437  unsigned int endIndex = 0 ) const;
438 
439  virtual unsigned int interactionClassPosition( const char* name,
440  unsigned int startIndex = 0,
441  unsigned int endIndex = 0 ) const;
442 
443  virtual bool resolveAttributeDimensions(MAKRti::DtString & errorString);
444  virtual bool resolveInteractionDimensions(MAKRti::DtString & errorString);
445  virtual bool resolveAttributeTransportations(MAKRti::DtString & errorString);
446  virtual bool resolveInteractionTransportations(MAKRti::DtString & errorString);
447  virtual bool resolveObjectClasses(MAKRti::DtString & errorString);
448  virtual bool resolveInteractionClasses(MAKRti::DtString & errorString);
449  virtual bool resolveAttributes(MAKRti::DtString & errorString);
450  virtual bool resolveParameters(MAKRti::DtString & errorString);
451  virtual bool resolveDimensions(MAKRti::DtString & errorString);
452 
453 protected:
454 
457 
460 
463 
466 
467 #ifdef DDM
468 
469  DtSpaceVector mySpaces;
470 
472  DtSpaceHandle myFirstSpaceHandle;
473 #endif
474 
477 
480 
484 
485 // //! Indicates a FOM module merge is taking place
486 // bool myMergingFomModule;
487 
488 
491 
495 
499 
500 protected:
501 
504 };
505 
506 #endif
507 
508 
509 

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)