VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
interactionHLA.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #ifndef interactionHLA_H_
7 #define interactionHLA_H_
8 
11 #if DtHLA
12 
13 
14 
16 
17 #include <vlutil/vlTimeStampType.h>
18 #include <vlutil/vlTime.h>
19 #include <vlutil/vlString.h>
20 #include <vl/interClassDesc.h>
21 
22 
25 class DT_DLL_VL DtList;
26 
34 {
35 public:
36 
38  DtInteraction();
39 
41  virtual ~DtInteraction();
42 
44  DtInteraction(const DtInteraction& orig);
45 
47  DtInteraction& operator=(const DtInteraction& orig);
48 
49 #if DtHLA_1516
50  virtual const RTI::ParameterHandleValueMap& phvm() const = 0;
52 #else
53  virtual const RTI::ParameterHandleValuePairSet& phvps() const = 0;
55 #endif
56 
57 #if DtHLA_1516
58  virtual void setFromPhvm(const RTI::ParameterHandleValueMap& pvList)=0;
60 #else
61  virtual void setFromPhvps(const RTI::ParameterHandleValuePairSet& pvList)=0;
63 #endif
64 
73  virtual void setExConn(DtExerciseConn* exConn,
74  DtInterClassDesc* classDesc = 0);
75 
77  virtual RTI::InteractionClassHandle interactionClassHandle() const;
78 
80  virtual char* interactionClassName() const;
81 
83  virtual int numParameters() const;
84 
87  virtual bool neededByFederation() const;
88 
90  virtual void print() const;
91 
93  virtual void printToStream(std::ostream& stream) const;
94 
96  virtual void printHeader() const;
97 
99  virtual void printHeaderToStream(std::ostream& stream) const;
100 
102  virtual void printData() const;
103 
105  virtual void printDataToString(DtString& buff) const;
106 
108  virtual void printDataToStream(std::ostream& stream) const;
109 
111  virtual void printParams(bool withHex) const;
112 
114  virtual void printParamsToStream(std::ostream& stream, bool withHex) const;
115 
117  virtual const char* name() const = 0;
118 
120  virtual DtExerciseConn* exerciseConn() const;
121 
124  virtual DtInterClassDesc* classDesc() const;
125 
127  virtual bool customTagSet() const;
128 
129 
130 #if DtHLA_1516
131  virtual void setCustomTag(const RTI::VariableLengthData& a_tag);
134  virtual void setTag(const RTI::VariableLengthData& tag);
136  virtual const RTI::VariableLengthData &tag() const;
137 #else
138  virtual void setCustomTag(const DtString& a_tag);
141  virtual void setTag(const DtString& tag);
143  virtual const DtString& tag() const;
144 #endif
145 
151 #if DtHLA_1516
152  virtual const RTI::RegionHandleSet* conveyedRegion() const;
153  virtual void setConveyedRegion(const RTI::RegionHandleSet* sentRegionHandleSet);
154 #else
155  virtual const RTI::Region* conveyedRegion() const;
156  virtual void setConveyedRegion(const RTI::Region* region);
157 #endif
158 
159 #if DtHLA_1516_EVOLVED
160  virtual void setProducingFederateHandle(RTI::FederateHandle federateHandle);
166 
168  virtual RTI::FederateHandle producingFederateHandle() const;
169 
172  virtual const DtString& producingFederateName() const;
173 #endif
174 
175 #if DtHLA_4
176  virtual void setTransportationTypeHandle(RTI::TransportationTypeHandle transportationTypeHandle);
178 
180  virtual RTI::TransportationTypeHandle transportationTypeHandle() const;
181 #endif
182 
186  virtual void setTimeStamp(DtTime time,
188 
191  virtual DtTime timeStamp() const;
192 
194  virtual DtTimeStampType timeStampType() const;
195 
200  virtual DtTime guessTimeValid(DtTime referenceTime) const;
201 
206 #if DtHLA_1516
207  virtual void setFedTime(const RTI::LogicalTime &ft);
208 #else
209  virtual void setFedTime(const RTI::FedTime &ft);
210 #endif
211 
215 #if DtHLA_1516
216  virtual const RTI::LogicalTime *fedTime() const;
217 #else
218  virtual const RTI::FedTime *fedTime() const;
219 #endif
220 
221 #if DtHLA_1516
222  virtual void setMessageRetractionHandle(const RTI::MessageRetractionHandle &handle);
225 
227  virtual RTI::MessageRetractionHandle messageRetractionHandle() const;
228 
229 #else
230  virtual void setEventRetractionHandle(const RTI::EventRetractionHandle &handle);
233 
235  virtual RTI::EventRetractionHandle eventRetractionHandle() const;
236 #endif
237 
238 
239 public:
240 
244  static void setTagIsAsciiTime(bool val);
245  static bool tagIsAsciiTime();
246 
249  static void addCallback(DtExerciseConn* conn,
250  const std::vector<DtString>* classes, DtReceiveInteractionCb cb, void* usr,
251  DtDDMRegionSP region = DtDDMRegionSP());
252  static void removeCallback(DtExerciseConn* conn,
253  const std::vector<DtString>* classes, DtReceiveInteractionCb cb, void* usr,
254  DtDDMRegionSP region = DtDDMRegionSP());
255 
257  static void addCallback(DtExerciseConn* conn,
258  const char* className, DtReceiveInteractionCb cb, void* usr,
259  DtDDMRegionSP region = DtDDMRegionSP());
260  static void removeCallback(DtExerciseConn* conn,
261  const char* className, DtReceiveInteractionCb cb, void* usr,
262  DtDDMRegionSP region = DtDDMRegionSP());
263 
264 protected:
265 
268  virtual const char* interactionClassToUse(DtExerciseConn* exConn) const;
269 
273 #if DtHLA_1516
274  virtual RTI::ParameterHandleValueMap &privPvList() const;
275 #else
276  virtual RTI::ParameterHandleValuePairSet* privPvList() const;
277 #endif
278 
286  DtInteraction* self() const;
287 
288 protected:
289 
294 
295 #if DtHLA_1516
296  RTI::LogicalTime *myFedTime;
297  RTI::ParameterHandleValueMap myPvList;
298  RTI::MessageRetractionHandle myRetractionHandle;
299  RTI::VariableLengthData myTag;
300  const RTI::RegionHandleSet* myConveyedRegion;
301 #if DtHLA_1516_EVOLVED
302  mutable DtString myProducingFederateName;
303  RTI::FederateHandle myProducingFederateHandle;
304 #endif
305 #if DtHLA_4
306  RTI::TransportationTypeHandle myTransportationTypeHandle;
307 #endif
308 #else
310  RTI::ParameterHandleValuePairSet* myPvList;
312  RTI::FedTime *myFedTime;
313  RTI::EventRetractionHandle myRetractionHandle;
314  const RTI::Region* myConveyedRegion;
315 #endif
316 
318 
319 
320 protected:
321 
322  static bool theTagIsAsciiTime;
323 };
324 
325 DT_DLL_VL std::ostream & operator << (std::ostream &str, const DtInteraction &inter);
326 
327 inline RTI::InteractionClassHandle
329 {
330  return myClassDesc->handle();
331 }
332 
334 {
335  return (char*) (myClassDesc ? myClassDesc->name() : 0);
336 }
337 
339 {
340  return myClassDesc ? myClassDesc->numParameters() : 0;
341 }
342 
344 {
345  return (DtInteraction*) this;
346 }
347 
349 {
350  return myExConn;
351 }
352 
354 {
355  return myClassDesc;
356 }
357 
358 inline void DtInteraction::printData() const
359 {
360 }
361 
363 {
364 }
365 
366 inline void DtInteraction::printDataToStream(std::ostream& stream) const
367 {
368 }
369 
370 #if DtHLA_1516
371 inline void DtInteraction::setMessageRetractionHandle(
372  const RTI::MessageRetractionHandle &handle)
373 {
374  myRetractionHandle = handle;
375 }
376 
377 inline RTI::MessageRetractionHandle DtInteraction::messageRetractionHandle() const
378 {
379  return myRetractionHandle;
380 }
381 
382 #else
384  const RTI::EventRetractionHandle &handle)
385 {
386  myRetractionHandle = handle;
387 }
388 
389 inline RTI::EventRetractionHandle DtInteraction::eventRetractionHandle() const
390 {
391  return myRetractionHandle;
392 }
393 #endif
394 
395 #endif
396 #endif
397 
398 
DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to ...
Definition: interactionHLA.h:33
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
Contains the DtString class declaration.
DtExerciseConn * myExConn
Definition: interactionHLA.h:291
std::ostream & operator<<(std::ostream &os, const Dt3dChord &chord)
Instances of DtInterClassDesc are used to represent HLA Object and Interaction classes.
Definition: interClassDesc.h:33
This file contains the declaration of DtClock and DtTime.
RTI::EventRetractionHandle myRetractionHandle
Definition: interactionHLA.h:313
Definition: vlTimeStampType.h:18
virtual DtInterClassDesc * classDesc() const
Get the current class descriptor we&#39;re using for this interaction.
Definition: interactionHLA.h:353
const RTI::Region * myConveyedRegion
Definition: interactionHLA.h:314
DtTimeStampType myTimeType
Definition: interactionHLA.h:293
virtual RTI::InteractionClassHandle interactionClassHandle() const
Get the interaction class handle. Returns 0 if no classDesc.
Definition: interactionHLA.h:328
virtual int numParameters() const
Get the number of parameters associated with this object.
Definition: interClassDesc.h:250
virtual char * interactionClassName() const
Get the interaction class name. Returns NULL if no classDesc.
Definition: interactionHLA.h:333
virtual DtExerciseConn * exerciseConn() const
Get the current exercise connection.
Definition: interactionHLA.h:348
This file contains the declaration of DtInterClassDesc.
static bool theTagIsAsciiTime
Definition: interactionHLA.h:322
virtual void printData() const
Print the interaction&#39;s data to DtInfo.
Definition: interactionHLA.h:358
DtList is deprecated, please use std::list&lt;T&gt;.
Definition: vlList.h:71
void(* DtReceiveInteractionCb)(DtInteraction *inter, void *usr)
Definition: receiveInteractionCbInfo.h:23
virtual RTI::EventRetractionHandle eventRetractionHandle() const
Get the event retraction handle. For more info see setEventRetractionHandle.
Definition: interactionHLA.h:389
#define LogicalTime
Definition: hlaLogicalTime.h:18
virtual void printDataToStream(std::ostream &stream) const
Print the interaction&#39;s data to the stream.
Definition: interactionHLA.h:366
std::shared_ptr< DtDDMRegion > DtDDMRegionSP
Definition: region13.h:31
bool myCustomTagSet
Definition: interactionHLA.h:317
DtInteraction * self() const
Get rid of const-ness on the &quot;this&quot; pointer in order to access non-const functions from const member ...
Definition: interactionHLA.h:343
DtInterClassDesc * myClassDesc
Definition: interactionHLA.h:290
int myPvListMaxSize
Definition: interactionHLA.h:311
DtTimeStampType
Definition: vlTimeStampType.h:16
RTI::ParameterHandleValuePairSet * myPvList
Definition: interactionHLA.h:310
Instances of DtString are used to represent strings.
Definition: vlString.h:36
RTI::FedTime * myFedTime
Definition: interactionHLA.h:312
virtual int numParameters() const
Get the number of parameters. Returns 0 if no classDesc.
Definition: interactionHLA.h:338
virtual RTI::InteractionClassHandle handle() const
Get the object&#39;s class handle.
Definition: interClassDesc.h:245
virtual void setEventRetractionHandle(const RTI::EventRetractionHandle &handle)
Get/Set the EventRetractionHandle.
Definition: interactionHLA.h:383
DtTime myTime
Definition: interactionHLA.h:292
DtString myTag
Definition: interactionHLA.h:309
virtual void printDataToString(DtString &buff) const
Print the interaction&#39;s data to the string provided.
Definition: interactionHLA.h:362
virtual const char * name() const
Get the object&#39;s class name.
Definition: interClassDesc.h:282

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)