MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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;
35 typedef std::vector<DtAttrInfo> DtAttrVector;
36 typedef DtFomClassMgr* (*DtFomClassMgrCreator)(DtRIDParameters* p);
38 typedef std::vector<DtObjectClassInfo*> DtObjectClassVector;
39 typedef std::vector<DtInteractionClassInfo*> DtInteractionClassVector;
40 
41 
42 
43 #ifdef DDM
44 typedef std::vector<DtSpaceInfo> DtSpaceVector;
45 #endif
46 
47 class DT_DLL_LRC DtFomClassMgr : public MAKRti::DtFedTarget
48 {
49 protected:
50 
53 
55  DtFomClassMgr();
56 
58  DtFomClassMgr& operator=(const DtFomClassMgr& orig);
59 
60 public:
61 
63  DtFomClassMgr(const DtFomClassMgr& orig);
64 
66  virtual ~DtFomClassMgr();
67 
68  //-------------------------------------------------------------------------
70  //-------------------------------------------------------------------------
71 
72 
74  virtual void addSpace(const char* name);
75 
78  virtual void addDimension(const char* spaceName, const char* dimName);
79 
81  virtual void addDimension(const char* dimName, unsigned long upperBound,
82  unsigned long defaultLowerBound, unsigned long defaultUpperBound,
83  bool excluded, const MAKRti::DtString& normalization);
84 
87  virtual bool addInteractionDimension(const char* interactionName,
88  const char* dimension);
89 
91  virtual bool addInterClass(const char* name, const char* baseName,
92  MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
93  DtSharingType sharing, const MAKRti::DtString& semantics,
94  const char* space=NULL);
95 
96  virtual bool addInterClass(const char* name, const char* baseName,
97  MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
98  const char* spaceName = NULL );
99 
100  virtual bool addObjClass( const char* name, const char* baseName,
101  DtSharingType sharing, const MAKRti::DtString& semantics );
102 
104  virtual bool addObjClass(const char* name, const char* baseName);
105 
106  virtual void addParameter(const char* className, const char* paramName );
107 
110  virtual void addParameter(const char* className,
111  const char* paramName,
112  const char* semantics );
113 
116  virtual bool addAttributeDimension(const char* className,
117  const char* attrName, const char* dimName);
118 
121  virtual void addAttribute(const char* className, const char* attrName,
122  MAKRti::DtTransportType transport, MAKRti::DtOrderType order, DtSharingType sharing,
123  DtFomUpdateType updateType, const MAKRti::DtString& updateCondition,
124  DtOwnershipType ownershipType, const MAKRti::DtString& semantics,
125  const char* spaceName=NULL );
126 
127  virtual void addAttribute(const char* className, const char* attrName,
128  MAKRti::DtTransportType transport, MAKRti::DtOrderType order, const char* spaceName=NULL );
129 
130  virtual void initUpdateRates(DtRIDParameters* params) ;
131 
132 
134  const MAKRti::DtUpdateRateSetT & getUpdateRates() const;
135 
137  float updateRateByName(const char * name);
138 
141  int positionOfRate(float rate) const;
142 
144  bool knownUpdateRate(const MAKRti::DtString& rateName) const;
145 
146 
148  virtual DtMergeFomStatus mergeObjectClasses( DtFedTarget const& module );
149 
151  virtual DtMergeFomStatus mergeObjectInfo( DtObjectClassInfo const& classInfo );
152 
154  virtual void mergeAttributes( DtObjectClassInfo const& classInfo,
155  DtFomClassMgr const& module );
156 
158  virtual DtMergeFomStatus mergeInteractionClasses( DtFedTarget const& module );
159 
161  virtual DtMergeFomStatus mergeInteractionInfo( DtInteractionClassInfo const & interInfo,
162  const char* spaceName = 0);
163 
165  virtual void mergeParameters( DtInteractionClassInfo const& interInfo );
166 
168  virtual DtMergeFomStatus mergeSpaces( DtFedTarget const& module );
169 
171  virtual DtMergeFomStatus mergeDimensions( DtSpaceInfo const& spaceInfo );
172 
174  virtual DtMergeFomStatus mergeSwitches( DtFedTarget const& module );
175 
176  //-------------------------------------------------------------------------
178  //-------------------------------------------------------------------------
179 
180  //------------------------------------------- Object classes and attributes
181 
183  virtual DtObjectClassHandle classHandle (
184  const char* theName,
185  bool throwException=true);
186 
189  virtual const char* className (
190  DtObjectClassHandle theHandle,
191  bool throwException=true);
192 
194  virtual DtAttributeHandle attrHandle (
195  const char* theName,
196  DtObjectClassHandle whichClass,
197  bool throwException=true);
198 
201  virtual const char* attrName (
202  DtAttributeHandle theHandle,
203  DtObjectClassHandle whichClass,
204  bool throwException=true);
205 
207  virtual DtObjectClassInfo* classByName(const char *name) const;
208 
210  virtual DtObjectClassInfo* classByHandle(
211  DtObjectClassHandle handle) const;
212 
214  virtual DtObjectClassInfo* objectRootClass() const;
215 
217  virtual DtObjectClassHandle objectRootHandle() const;
218 
220  virtual int numClasses() const;
221 
228  virtual void addClassHdlForUnknownClass(DtObjectClassHandle handle,
229  DtObjectClassHandle baseClassHandle);
230 
231  //------------------------------------------- Regions and spaces
232 #ifdef DDM
233 
234  virtual DtSpaceHandle spaceHandle (
235  const char* theName,
236  bool throwException=true) const;
237 
240  virtual const char* spaceName (
241  DtSpaceHandle theHandle,
242  bool throwException=true) const;
243 
245  virtual DtDimensionHandle dimHandle (
246  const char* theName,
247  DtSpaceHandle whichSpace,
248  bool throwException=true) const;
249 
252  virtual const char* dimName (
253  DtDimensionHandle theHandle,
254  DtSpaceHandle whichSpace,
255  bool throwException=true) const;
256 
258  virtual unsigned long dimUpperBound(
259  DtDimensionHandle theHandle,
260  DtSpaceHandle whichSpace,
261  bool throwException=true);
262 
264  virtual DtDimensionHandleSet const & getAvailableDimensionsForClassAttribute(
265  DtObjectClassHandle passedInClassHandle, DtAttributeHandle attrHandle);
266 
268  virtual DtDimensionHandleSet const &
269  getAvailableDimensionsForInteractionClass(
270  DtInteractionClassHandle passedInClassHandle);
271 
273  virtual DtSpaceInfo* spaceByName(const char *name);
274  virtual const DtSpaceInfo* spaceByName(const char *name) const;
275 
277  virtual DtSpaceInfo* spaceByHandle(DtSpaceHandle handle);
278  virtual const DtSpaceInfo* spaceByHandle(DtSpaceHandle handle) const;
279 
281  virtual int numSpaces() const;
282 #endif
283 
284  //------------------------------------------- Interactions and parameters
285 
287  virtual DtInteractionClassInfo* interactionByName(const char *name) const;
288 
290  virtual DtInteractionClassInfo* interactionByHandle(
291  DtInteractionClassHandle handle) const;
292 
294  virtual DtInteractionClassInfo* interactionRootClass() const;
295 
297  virtual DtInteractionClassHandle interactionRootHandle() const;
298 
300  virtual DtInteractionClassHandle interactionHandle (
301  const char* theName,
302  bool throwException=true);
303 
306  virtual const char* interactionName (
307  DtInteractionClassHandle theHandle,
308  bool throwException=true);
309 
311  virtual DtParameterHandle paramHandle (
312  const char* theName,
313  DtInteractionClassHandle whichClass,
314  bool throwException=true);
315 
318  virtual const char* paramName (
319  DtParameterHandle theHandle,
320  DtInteractionClassHandle whichClass,
321  bool throwException=true);
322 
324  virtual int numInteractions() const;
325 
332  virtual void addInteractionHdlForUnknownClass(DtInteractionClassHandle handle,
333  DtInteractionClassHandle baseClassHandle);
334 
335  //-------------------------------------------------------------------------
337  //-------------------------------------------------------------------------
338 
339  virtual void initDMFilteringParameters(const DtRIDParameters* params);
340  virtual void printDMSubscriptions();
341 
342  //-------------------------------------------------------------------------
344  //-------------------------------------------------------------------------
345 
347  virtual bool save(DtRtiSaveFile& file);
348 
350  virtual void prepareToRestore();
351 
353  virtual bool restore( DtRtiSaveFile& file );
354 
356  virtual void setExtend13and1516interop(bool enable);
357  virtual bool extend13and1516interop() const;
358 
360  virtual void print() const;
361 
363  virtual DtFomClassMgr* clone();
364 
366  virtual void setDistributor(DtSynchronousFileDistributor* distributor);
367  virtual DtSynchronousFileDistributor* distributor() const;
368 
369  //-------------------------------------------------------------------------
371  //-------------------------------------------------------------------------
372 
375  virtual void setConveyRegionDesignatorSets(bool value);
376 
377  virtual void addFedFileName(const MAKRti::DtString & name);
378  virtual const std::vector<MAKRti::DtString>& fedFiles() const;
379 
383  // TODO make this into a method getter/setter thingie
384  unsigned long myCrc;
385 
386 public:
387 
389  static DtFomClassMgr* create(DtRIDParameters* p);
390 
394  static void setCreatorFunction(DtFomClassMgrCreator fn);
395 
396 protected:
397 
398  void init();
399 
400 #ifdef DDM
401 
402  virtual void addSpaceSorted( const char* nameValue );
403  virtual void addSpaceUnsorted( const char* nameValue );
404 #endif
405 
407  virtual DtInteractionClassInfo* addInterClassSorted( const char* name,
408  const char* baseName, MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
409  DtSpaceHandle spaceH, DtInteractionClassInfo* baseClass,
410  DtSharingType sharing,
411  const MAKRti::DtString& semantics );
412  virtual DtInteractionClassInfo* addInterClassUnsorted( const char* name,
413  const char* baseName, MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
414  DtSpaceHandle spaceH, DtInteractionClassInfo* baseClass,
415  DtSharingType sharing, const MAKRti::DtString& semantics );
416 
418  virtual DtObjectClassInfo* addObjClassSorted( const char* name,
419  const char* baseName, DtSharingType sharing,
420  const MAKRti::DtString& semantics, DtObjectClassInfo* baseClass );
421  virtual DtObjectClassInfo* addObjClassUnsorted( const char* name,
422  const char* baseName, DtSharingType sharing,
423  const MAKRti::DtString& semantics, DtObjectClassInfo* baseClass );
424 
427  virtual bool objectClassPresent(const char* name,
428  unsigned int startIndex = 0,
429  unsigned int endIndex = 0 ) const;
430 
431  virtual bool attrPresent( const char *name,
432  DtObjectClassInfo* classInfo,
433  unsigned int startIndex = 0,
434  unsigned int endIndex = 0 ) const;
435 
436  virtual bool interactionClassPresent(const char* name,
437  unsigned int startIndex = 0,
438  unsigned int endIndex = 0 ) const;
439 
441  virtual unsigned int objectClassPosition( const char* name,
442  unsigned int startIndex = 0,
443  unsigned int endIndex = 0 ) const;
444 
445  virtual unsigned int interactionClassPosition( const char* name,
446  unsigned int startIndex = 0,
447  unsigned int endIndex = 0 ) const;
448 
449  virtual bool resolveAttributeDimensions(MAKRti::DtString & errorString, bool& fomReadError);
450  virtual bool resolveInteractionDimensions(MAKRti::DtString & errorString, bool& fomReadError);
451  virtual bool resolveAttributeTransportations(MAKRti::DtString & errorString, bool& fomReadError);
452  virtual bool resolveInteractionTransportations(MAKRti::DtString & errorString, bool& fomReadError);
453  virtual bool resolveObjectClasses(MAKRti::DtString & errorString, bool& fomReadError);
454  virtual bool resolveInteractionClasses(MAKRti::DtString & errorString, bool& fomReadError);
455  virtual bool resolveAttributes(MAKRti::DtString & errorString, bool& fomReadError);
456  virtual bool resolveParameters(MAKRti::DtString & errorString, bool& fomReadError);
457  virtual bool resolveDimensions(MAKRti::DtString & errorString, bool& fomReadError);
458 
459  // Helper functions for resolving.
460  virtual void addAttrInfoToChildren(DtObjectClassInfo* classDesc,
461  const MAKRti::DtString& attributeName,
462  DtDimensionHandle dimensionHandle);
463 
464 protected:
465 
468 
471 
474 
477 
478 #ifdef DDM
479 
480  DtSpaceVector mySpaces;
481 
483  DtSpaceHandle myFirstSpaceHandle;
484 #endif
485 
488 
491 
495 
496 // //! Indicates a FOM module merge is taking place
497 // bool myMergingFomModule;
498 
500 
501  // This is all FOM files merged in this target. It includes the MIM and is in merge order.
502  std::vector<MAKRti::DtString> myFedFiles;
503 
506 
510 
514 
515 protected:
516 
519 };
520 
521 #endif
522 
523 
524 

Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)