MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
momSR.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright(c) 2001 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: momSR.h,v $ $Revision: 1.21 $ $State: Exp $
7 *********************************************************************/
8 #ifdef DtMOM
9 
12 #ifndef DtMomSR_H_
13 #define DtMomSR_H_
14 
15 #include <vlutil/vlHashlist.h>
16 #include "momInspector.h"
17 #include "momElement.h"
18 #include "objMgr.h"
19 
20 #if defined(DtIFSPEC13)
21 #ifdef DtIFSPEC13DLC
22 #include "RTI13.h"
23 #define RTI rti13
24 #else
25 #include "RTI.hh"
26 #endif
27 #elif defined(DtIFSPEC1516) || defined(DtIFSPEC1516E)
28 #include <RTI/LogicalTime.h>
29 #include <RTI/LogicalTimeInterval.h>
30 #else
31 #include <RTI/time/LogicalTime.h>
32 #include <RTI/time/LogicalTimeInterval.h>
33 #endif
34 
35 enum DT_DLL_LRC DtMomUpdateType
36 {
37  DtMomUpdateStatic,
38  DtMomUpdateConditional,
39  DtMomUpdatePeriodic
40 };
41 
42 class DtFomClassMgr;
43 class DtMomInspector;
44 class DtMomHandleList;
45 class DtAhvps;
46 
47 class DT_DLL_LRC DtMomSR
48 {
49 public:
50 
52  DtMomSR(DtFomClassMgr* fomPtr, DtMomInspector* servicePtr,
53  DtRtiObject* objPtr);
54 
56  virtual ~DtMomSR();
57 
59  DtMomSR(const DtMomSR& orig);
60 
62  DtMomSR& operator=(const DtMomSR& orig);
63 
65  virtual void forceUpdate(DtAttributeHandleSet const & set);
66 
70  virtual void putElement(const char* name, DtMomElement element,
71  DtMomUpdateType updateType);
72 
74  virtual DtMomElement element(DtAttributeHandle attribute);
75 
77  virtual DtAttributeHandle attribute(DtMomElement element);
78 
80  virtual void encodeAttribute(DtAhvps* vp, DtAttributeHandle attribute) = 0;
81 
83  virtual DtAttributeHandleSet const& updateAttributes() const;
84 
86  virtual DtAttributeHandleSet const& fullAttributes() const;
87 
89  virtual DtAttributeHandleSet const& conditionalAttributes() const;
90 
92  virtual DtAttributeHandleSet const& periodicAttributes() const;
93 
95  virtual DtAttributeHandleSet const& staticAttributes() const;
96 
98  inline DtObjectInstanceHandle objectInstanceHandle() const;
99 
100 protected:
101 
103  virtual DtMomInspector* localService();
104  virtual DtMomInspector const * localService() const;
105 
106 protected:
107 
108  DtFomClassMgr* myFom;
109  DtMomInspector* myService;
110  DtRtiObject* myObject;
111  DtHandle myPrivilege;
112  DtHandle myClassHandle;
113  std::map<DtAttributeHandle, DtMomElement> myAttributeToElementMap;
114  std::map<DtMomElement, DtAttributeHandle> myElementToAttributeMap;
115  DtUpdateType myUpdateType;
116  DtAttributeHandleSet myUpdateAttributes;
117  DtAttributeHandleSet myConditionalAttributes;
118  DtAttributeHandleSet myPeriodicAttributes;
119  DtAttributeHandleSet myStaticAttributes;
121  DtAttributeHandleSet myFullAttributes;
122 
123  mutable DtRtiApiUniquePtr<DtRtiApiTime> myTime;
124  DtRtiApiUniquePtr<DtRtiApiTimeInterval> myInterval;
125 };
126 
127 
128 inline DtObjectInstanceHandle DtMomSR::objectInstanceHandle() const
129 {
130  DtObjectInstanceHandle hdl = 0;
131  if(myObject)
132  {
133  hdl = myObject->objHandle();
134  }
135  return hdl;
136 }
137 
138 #define ATTRIBUTE_DECLARATION_BY_VALUE(AttributeType, Attribute) \
139 public: \
140  virtual AttributeType get##Attribute() const; \
141 protected: \
142  virtual void encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute);
143 
144 #define ATTRIBUTE_DECLARATION_BY_VALUE_NON_CONST(AttributeType, Attribute) \
145 public: \
146  virtual AttributeType get##Attribute(); \
147 protected: \
148  virtual void encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute);
149 
150 #define ATTRIBUTE_DECLARATION_BY_REF(AttributeType, Attribute) \
151 public: \
152  virtual AttributeType const & get##Attribute() const; \
153 protected: \
154  virtual void encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute);
155 
156 #define ATTRIBUTE_WITH_PARAM_DECLARATION(AttributeType, Attribute) \
157 public: \
158  virtual bool get##Attribute(AttributeType& value) const; \
159 protected: \
160  virtual void encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute);
161 
162 
163 #define ATTRIBUTE_DEFINITION_BY_VALUE(StateRepClass, AttributeType, Attribute) \
164 AttributeType StateRepClass::get##Attribute() const \
165 { \
166  return localService()->get##Attribute(); \
167 } \
168 void StateRepClass::encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute) \
169 { \
170  DtMomNetParameter netAttribute(get##Attribute()); \
171  vp->add(attribute, netAttribute.netRep(), netAttribute.length()); \
172 }
173 
174 #define ATTRIBUTE_DEFINITION_BY_VALUE_NON_CONST(StateRepClass, AttributeType, Attribute) \
175 AttributeType StateRepClass::get##Attribute() \
176 { \
177  return localService()->get##Attribute(); \
178 } \
179 void StateRepClass::encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute) \
180 { \
181  DtMomNetParameter netAttribute(get##Attribute()); \
182  vp->add(attribute, netAttribute.netRep(), netAttribute.length()); \
183 }
184 
185 #define ATTRIBUTE_DEFINITION_BY_REF(StateRepClass, AttributeType, Attribute) \
186 AttributeType const& StateRepClass::get##Attribute() const \
187 { \
188  return localService()->get##Attribute(); \
189 } \
190 void StateRepClass::encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute) \
191 { \
192  DtMomNetParameter netAttribute(get##Attribute()); \
193  vp->add(attribute, netAttribute.netRep(), netAttribute.length()); \
194 }
195 
196 #define ATTRIBUTE_WITH_PARAM_DEFINITION(StateRepClass, AttributeType, AttributeTemp, Attribute) \
197 bool StateRepClass::get##Attribute(AttributeType& value) const \
198 { \
199  return localService()->get##Attribute(value); \
200 } \
201 void StateRepClass::encode##Attribute(DtAhvps* vp, DtAttributeHandle attribute) \
202 { \
203  DtMomNetParameter netAttribute; \
204  if (get##Attribute(AttributeTemp)) \
205  { \
206  netAttribute = AttributeTemp; \
207  } \
208  else \
209  { \
210  netAttribute = (unsigned long)0; \
211  } \
212  vp->add(attribute, netAttribute.netRep(), netAttribute.length()); \
213 }
214 
215 
216 #endif
217 #endif
The declaration of the object manager class.
DtUpdateType
Update type for object.
Definition: rtiObject.h:94
Defines the internal representation of attribute/parameter handle sets.
Definition: attrHandSet.h:30
DtHandle DtObjectInstanceHandle
Definition: internalTypes.h:50
The RTI object maintains the internal RTI object state.
Definition: rtiObject.h:123
Definition: fomMgr.h:49
unsigned long DtHandle
The internal types.
Definition: internalTypes.h:41
DtHandle DtAttributeHandle
Definition: internalTypes.h:54
Definition: aHandValSet.h:33
#define DT_DLL_LRC
Definition: rtiMsConfig.h:155

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)