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 #ifdef _WIN32
29 #ifdef MAK_ENABLE_CRT_DEBUG
30 #include <vlutil/vlDebugCrt.h>
31 #endif
32 #endif
33 
34 
37 
38 class DtFomClassMgr;
39 class DtAttrInfo;
41 typedef std::vector<DtAttrInfo> DtAttrVector;
42 typedef DtFomClassMgr* (*DtFomClassMgrCreator)(DtRIDParameters* p);
44 typedef std::vector<DtObjectClassInfo*> DtObjectClassVector;
45 typedef std::vector<DtInteractionClassInfo*> DtInteractionClassVector;
46 
47 
48 
49 #ifdef DDM
50 typedef std::vector<DtSpaceInfo> DtSpaceVector;
51 #endif
52 
53 class DT_DLL_LRC DtFomClassMgr : public MAKRti::DtFedTarget
54 {
55 protected:
56 
59 
61  DtFomClassMgr& operator=(const DtFomClassMgr& orig);
62 
63 public:
64 
68  DtFomClassMgr();
69 
71  DtFomClassMgr(const DtFomClassMgr& orig);
72 
74  virtual ~DtFomClassMgr();
75 
76  //-------------------------------------------------------------------------
78  //-------------------------------------------------------------------------
79 
80 
82  virtual void addSpace(const char* name);
83 
86  virtual void addDimension(const char* spaceName, const char* dimName);
87 
89  virtual void addDimension(const char* dimName, unsigned long upperBound,
90  unsigned long defaultLowerBound, unsigned long defaultUpperBound,
91  bool excluded, const MAKRti::DtString& normalization);
92 
95  virtual bool addInteractionDimension(const char* interactionName,
96  const char* dimension);
97 
99  virtual bool addInterClass(const char* name, const char* baseName,
100  MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
101  DtSharingType sharing, const MAKRti::DtString& semantics,
102  const char* space=NULL);
103 
104  virtual bool addInterClass(const char* name, const char* baseName,
105  MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
106  const char* spaceName = NULL );
107 
108  virtual bool addObjClass( const char* name, const char* baseName,
109  DtSharingType sharing, const MAKRti::DtString& semantics );
110 
112  virtual bool addObjClass(const char* name, const char* baseName);
113 
114  virtual void addParameter(const char* className, const char* paramName );
115 
118  virtual void addParameter(const char* className,
119  const char* paramName,
120  const char* semantics );
121 
124  virtual bool addAttributeDimension(const char* className,
125  const char* attrName, const char* dimName);
126 
129  virtual void addAttribute(const char* className, const char* attrName,
130  MAKRti::DtTransportType transport, MAKRti::DtOrderType order, DtSharingType sharing,
131  DtFomUpdateType updateType, const MAKRti::DtString& updateCondition,
132  DtOwnershipType ownershipType, const MAKRti::DtString& semantics,
133  const char* spaceName=NULL );
134 
135  virtual void addAttribute(const char* className, const char* attrName,
136  MAKRti::DtTransportType transport, MAKRti::DtOrderType order, const char* spaceName=NULL );
137 
138  virtual void initUpdateRates(DtRIDParameters* params) ;
139 
140 
142  const MAKRti::DtUpdateRateSetT & getUpdateRates() const;
143 
145  float updateRateByName(const char * name);
146 
149  int positionOfRate(float rate) const;
150 
152  bool knownUpdateRate(const MAKRti::DtString& rateName) const;
153 
154 
156  virtual DtMergeFomStatus mergeObjectClasses( DtFedTarget const& module );
157 
159  virtual DtMergeFomStatus mergeObjectInfo( DtObjectClassInfo const& classInfo );
160 
162  virtual void mergeAttributes( DtObjectClassInfo const& classInfo,
163  DtFomClassMgr const& module );
164 
166  virtual DtMergeFomStatus mergeInteractionClasses( DtFedTarget const& module );
167 
169  virtual DtMergeFomStatus mergeInteractionInfo( DtInteractionClassInfo const & interInfo,
170  const char* spaceName = 0);
171 
173  virtual void mergeParameters( DtInteractionClassInfo const& interInfo );
174 
176  virtual DtMergeFomStatus mergeSpaces( DtFedTarget const& module );
177 
179  virtual DtMergeFomStatus mergeDimensions( DtSpaceInfo const& spaceInfo );
180 
182  virtual DtMergeFomStatus mergeSwitches( DtFedTarget const& module );
183 
184  //-------------------------------------------------------------------------
186  //-------------------------------------------------------------------------
187 
188  //------------------------------------------- Object classes and attributes
189 
191  virtual DtObjectClassHandle classHandle (
192  const char* theName,
193  bool throwException=true);
194 
197  virtual const char* className (
198  DtObjectClassHandle theHandle,
199  bool throwException=true);
200 
202  virtual DtAttributeHandle attrHandle (
203  const char* theName,
204  DtObjectClassHandle whichClass,
205  bool throwException=true);
206 
209  virtual const char* attrName (
210  DtAttributeHandle theHandle,
211  DtObjectClassHandle whichClass,
212  bool throwException=true);
213 
215  virtual DtObjectClassInfo* classByName(const char *name) const;
216 
218  virtual DtObjectClassInfo* classByHandle(
219  DtObjectClassHandle handle) const;
220 
222  virtual DtObjectClassInfo* objectRootClass() const;
223 
225  virtual DtObjectClassHandle objectRootHandle() const;
226 
228  virtual int numClasses() const;
229 
236  virtual void addClassHdlForUnknownClass(DtObjectClassHandle handle,
237  DtObjectClassHandle baseClassHandle);
238 
239  //------------------------------------------- Regions and spaces
240 #ifdef DDM
241 
242  virtual DtSpaceHandle spaceHandle (
243  const char* theName,
244  bool throwException=true) const;
245 
248  virtual const char* spaceName (
249  DtSpaceHandle theHandle,
250  bool throwException=true) const;
251 
253  virtual DtDimensionHandle dimHandle (
254  const char* theName,
255  DtSpaceHandle whichSpace,
256  bool throwException=true) const;
257 
260  virtual const char* dimName (
261  DtDimensionHandle theHandle,
262  DtSpaceHandle whichSpace,
263  bool throwException=true) const;
264 
266  virtual unsigned long dimUpperBound(
267  DtDimensionHandle theHandle,
268  DtSpaceHandle whichSpace,
269  bool throwException=true);
270 
272  virtual DtDimensionHandleSet const & getAvailableDimensionsForClassAttribute(
273  DtObjectClassHandle passedInClassHandle, DtAttributeHandle attrHandle);
274 
276  virtual DtDimensionHandleSet const &
277  getAvailableDimensionsForInteractionClass(
278  DtInteractionClassHandle passedInClassHandle);
279 
281  virtual DtSpaceInfo* spaceByName(const char *name);
282  virtual const DtSpaceInfo* spaceByName(const char *name) const;
283 
285  virtual DtSpaceInfo* spaceByHandle(DtSpaceHandle handle);
286  virtual const DtSpaceInfo* spaceByHandle(DtSpaceHandle handle) const;
287 
289  virtual int numSpaces() const;
290 #endif
291 
292  //------------------------------------------- Interactions and parameters
293 
295  virtual DtInteractionClassInfo* interactionByName(const char *name) const;
296 
298  virtual DtInteractionClassInfo* interactionByHandle(
299  DtInteractionClassHandle handle) const;
300 
302  virtual DtInteractionClassInfo* interactionRootClass() const;
303 
305  virtual DtInteractionClassHandle interactionRootHandle() const;
306 
308  virtual DtInteractionClassHandle interactionHandle (
309  const char* theName,
310  bool throwException=true);
311 
314  virtual const char* interactionName (
315  DtInteractionClassHandle theHandle,
316  bool throwException=true);
317 
319  virtual DtParameterHandle paramHandle (
320  const char* theName,
321  DtInteractionClassHandle whichClass,
322  bool throwException=true);
323 
326  virtual const char* paramName (
327  DtParameterHandle theHandle,
328  DtInteractionClassHandle whichClass,
329  bool throwException=true);
330 
332  virtual int numInteractions() const;
333 
340  virtual void addInteractionHdlForUnknownClass(DtInteractionClassHandle handle,
341  DtInteractionClassHandle baseClassHandle);
342 
343  //-------------------------------------------------------------------------
345  //-------------------------------------------------------------------------
346 
347  virtual void initDMFilteringParameters(const DtRIDParameters* params);
348  virtual void printDMSubscriptions();
349 
350  //-------------------------------------------------------------------------
352  //-------------------------------------------------------------------------
353 
355  virtual bool save(DtRtiSaveFile& file);
356 
358  virtual void prepareToRestore();
359 
361  virtual bool restore( DtRtiSaveFile& file );
362 
364  virtual void setExtend13and1516interop(bool enable);
365  virtual bool extend13and1516interop() const;
366 
368  virtual void print() const;
369 
371  virtual DtFomClassMgr* clone();
372 
374  virtual void setDistributor(DtSynchronousFileDistributor* distributor);
375  virtual DtSynchronousFileDistributor* distributor() const;
376 
377  //-------------------------------------------------------------------------
379  //-------------------------------------------------------------------------
380 
383  virtual void setConveyRegionDesignatorSets(bool value);
384 
385  virtual void addFedFileName(const MAKRti::DtString & name);
386  virtual const std::vector<MAKRti::DtString>& fedFiles() const;
387 
391  // TODO make this into a method getter/setter thingie
392  unsigned long myCrc;
393 
394 public:
395 
397  static DtFomClassMgr* create(DtRIDParameters* p);
398 
402  static void setCreatorFunction(DtFomClassMgrCreator fn);
403 
404 protected:
405 
406  void init();
407 
408 #ifdef DDM
409 
410  virtual void addSpaceSorted( const char* nameValue );
411  virtual void addSpaceUnsorted( const char* nameValue );
412 #endif
413 
415  virtual DtInteractionClassInfo* addInterClassSorted( const char* name,
416  const char* baseName, MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
417  DtSpaceHandle spaceH, DtInteractionClassInfo* baseClass,
418  DtSharingType sharing,
419  const MAKRti::DtString& semantics );
420  virtual DtInteractionClassInfo* addInterClassUnsorted( const char* name,
421  const char* baseName, MAKRti::DtTransportType transport, MAKRti::DtOrderType order,
422  DtSpaceHandle spaceH, DtInteractionClassInfo* baseClass,
423  DtSharingType sharing, const MAKRti::DtString& semantics );
424 
426  virtual DtObjectClassInfo* addObjClassSorted( const char* name,
427  const char* baseName, DtSharingType sharing,
428  const MAKRti::DtString& semantics, DtObjectClassInfo* baseClass );
429  virtual DtObjectClassInfo* addObjClassUnsorted( const char* name,
430  const char* baseName, DtSharingType sharing,
431  const MAKRti::DtString& semantics, DtObjectClassInfo* baseClass );
432 
435  virtual bool objectClassPresent(const char* name,
436  unsigned int startIndex = 0,
437  unsigned int endIndex = 0 ) const;
438 
439  virtual bool attrPresent( const char *name,
440  DtObjectClassInfo* classInfo,
441  unsigned int startIndex = 0,
442  unsigned int endIndex = 0 ) const;
443 
444  virtual bool interactionClassPresent(const char* name,
445  unsigned int startIndex = 0,
446  unsigned int endIndex = 0 ) const;
447 
449  virtual unsigned int objectClassPosition( const char* name,
450  unsigned int startIndex = 0,
451  unsigned int endIndex = 0 ) const;
452 
453  virtual unsigned int interactionClassPosition( const char* name,
454  unsigned int startIndex = 0,
455  unsigned int endIndex = 0 ) const;
456 
457  virtual bool resolveAttributeDimensions(MAKRti::DtString & errorString, bool& fomReadError);
458  virtual bool resolveInteractionDimensions(MAKRti::DtString & errorString, bool& fomReadError);
459  virtual bool resolveAttributeTransportations(MAKRti::DtString & errorString, bool& fomReadError);
460  virtual bool resolveInteractionTransportations(MAKRti::DtString & errorString, bool& fomReadError);
461  virtual bool resolveObjectClasses(MAKRti::DtString & errorString, bool& fomReadError);
462  virtual bool resolveInteractionClasses(MAKRti::DtString & errorString, bool& fomReadError);
463  virtual bool resolveAttributes(MAKRti::DtString & errorString, bool& fomReadError);
464  virtual bool resolveParameters(MAKRti::DtString & errorString, bool& fomReadError);
465  virtual bool resolveDimensions(MAKRti::DtString & errorString, bool& fomReadError);
466 
467  // Helper functions for resolving.
468  virtual void addAttrInfoToChildren(DtObjectClassInfo* classDesc,
469  const MAKRti::DtString& attributeName,
470  DtDimensionHandle dimensionHandle);
471 
472 protected:
473 
476 
479 
482 
485 
486 #ifdef DDM
487 
488  DtSpaceVector mySpaces;
489 
491  DtSpaceHandle myFirstSpaceHandle;
492 #endif
493 
496 
499 
503 
504 // //! Indicates a FOM module merge is taking place
505 // bool myMergingFomModule;
506 
508 
509  // This is all FOM files merged in this target. It includes the MIM and is in merge order.
510  std::vector<MAKRti::DtString> myFedFiles;
511 
514 
518 
522 
523 protected:
524 
527 };
528 
529 #endif
530 
531 
532 

Document ID: Generated on Fri Sep 27 00:57:56 EDT 2019 from SVN revision 201708
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)