VR-Link API Documentation for HLA Evolved
intClassDesc.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
7 
8 #ifndef DtInterClassDesc_H_
9 #define DtInterClassDesc_H_
10 
11 #if DtHLA
12 
13 #include <vlutil/vlMachineTypes.h>
14 #include "rtiNamespace.h"
15 #include "region.h"
16 #include <vlutil/vlString.h>
17 #include "userTagModifiers.h"
18 #include <set>
19 
20 class DtExerciseConn;
21 class DtVrlRtiAmbassador;
22 
23 
28 {
29 public:
30 
32  DtInterClassDesc(const char* className,
33  DtInterClassDesc* base, RTI::InteractionClassHandle handle,
34  DtExerciseConn* exConn);
35 
37  virtual ~DtInterClassDesc();
38 
40  virtual void addParam(const char* paramName);
41 
43  virtual RTI::InteractionClassHandle handle() const;
44 
46  virtual const char* name() const;
47 
49  virtual const DtInterClassDesc* baseClass() const;
50 
52  virtual DtInterClassDesc* baseClass();
53 
56  virtual int isOfClass(RTI::InteractionClassHandle hand) const;
57 
59  virtual int numParameters() const;
60 
62  virtual RTI::ParameterHandle parameterHandleByName(const char *paramName);
63 
65  virtual DtString parameterNameByHandle(const RTI::ParameterHandle& hand);
66 
67 #if !DtHLA_1516
68 
69  virtual int minParamHandle() const;
70  virtual int maxParamHandle() const;
71 #endif
72 
75 #if DtHLA_1516
76  virtual const RTI::ParameterHandleSet& paramHandleSet() const;
77 #else
78  virtual const RTI::AttributeHandleSet& paramHandleSet() const;
79 #endif
80 
82 #if DtHLA_1516
83  virtual const RTI::ParameterHandleSet& ownParamHandles() const;
84 #else
85  virtual const RTI::AttributeHandleSet& ownParamHandles() const;
86 #endif
87 
89  virtual void publish();
90 
92  virtual void unpublish();
93 
95  virtual void subscribe();
96 
98  virtual void subscribe(DtDDMRegionSP region);
99 
101  virtual void passiveSubscribe();
102 
104  virtual void unsubscribe();
105 
107  virtual void unsubscribe(DtDDMRegionSP region);
108 
110  virtual bool published() const;
111 
113  virtual bool subscribed() const;
114 
116  virtual DtVrlRtiAmbassador* rtiAmb();
117 
120  virtual bool neededByFederation() const;
121 
124  virtual bool everPublished() const;
125 
128  virtual bool everSubscribed() const;
129 
130  virtual void setUserTagModifier(DtInteractionTagModifierSP modifier);
131  virtual DtInteractionTagModifierSP userTagModifier();
132 
133 public:
134 
136  static void setMaxParameters(int num);
137  static int maxParameters();
138 
144  static void setSubscriptionTimeDelay(double delay);
145 
146 
147 protected:
148 
150  static void startIntersCb(RTI::InteractionClassHandle hand,
151  void* usr);
152 
154  static void stopIntersCb(RTI::InteractionClassHandle hand,
155  void* usr);
156 
158  virtual void processStartInters(RTI::InteractionClassHandle hand);
159 
161  virtual void processStopInters(RTI::InteractionClassHandle hand);
162 
163 protected:
164 
166  DtInterClassDesc(const DtInterClassDesc& orig);
167 
169  DtInterClassDesc& operator=(const DtInterClassDesc& orig);
170 
171 protected:
172 
174  RTI::InteractionClassHandle myHandle;
175 #if DtHLA_1516
176  RTI::ParameterHandleSet* myParams;
177  RTI::ParameterHandleSet* myOwnParams;
178 #else
179  RTI::AttributeHandleSet* myParams;
180  RTI::AttributeHandleSet* myOwnParams;
181 #endif
189  RTI::ParameterHandle myMinParamHand;
190  RTI::ParameterHandle myMaxParamHand;
193  std::set<DtDDMRegionSP> mySubscribedRegions;
194 
195 protected:
196 
197  static int theMaxParams;
199 };
200 
201 inline RTI::InteractionClassHandle DtInterClassDesc::handle() const
202 {
203  return myHandle;
204 }
205 
207 {
208  return myParams->size();
209 }
210 #if DtHLA_1516
211 inline const RTI::ParameterHandleSet& DtInterClassDesc::paramHandleSet() const
212 #else
213 inline const RTI::AttributeHandleSet& DtInterClassDesc::paramHandleSet() const
214 #endif
215 {
216  return *myParams;
217 }
218 
219 #if DtHLA_1516
220 inline const RTI::ParameterHandleSet& DtInterClassDesc::ownParamHandles() const
221 #else
222 inline const RTI::AttributeHandleSet& DtInterClassDesc::ownParamHandles() const
223 #endif
224 {
225  return *myOwnParams;
226 }
227 
229 {
230  return theMaxParams;
231 }
232 
234 {
235  theMaxParams = num;
236 }
237 
238 inline const char* DtInterClassDesc::name() const
239 {
240  return myName.c_str();
241 }
242 
244 {
245  return myBase;
246 }
247 
249 {
250  return myBase;
251 }
252 
254 {
255  theSubscriptionTimeDelay = delay;
256 }
257 
258 
259 #endif
260 #endif
261 

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)