VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
createEntityInteractionHLA.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
6 
7 #ifndef createEntityInteractionHLA_H_
8 #define createEntityInteractionHLA_H_
9 
10 #if DtHLA
11 
12 #include "interactionWithEncDec.h"
13 #include "hostStructs.h"
14 #include <matrix/vlMath.h>
15 
16 
17 
21 
24 
25 
27 typedef void (*DtCreateEntityInteractionCb)(
28  DtCreateEntityInteraction* inter, void* usr);
29 
30 
31 
35 class DT_DLL_VL DtCreateEntityInteraction : public DtInteractionWithEncDec
36 {
37 public:
38 
41 
43  virtual ~DtCreateEntityInteraction();
44 
47 
50 
52  virtual void printData() const;
53 
55  virtual void printDataToStream(std::ostream& stream) const;
56 
58  virtual void setSenderId(const DtEntityIdentifier& id);
59  virtual const DtEntityIdentifier& senderId() const;
60 
62  virtual void setReceiverId(const DtEntityIdentifier& id);
63  virtual const DtEntityIdentifier& receiverId() const;
64 
66  virtual void setRequestId(int id);
67  virtual int requestId() const;
68 
70  virtual const char* name() const;
71 
72 public:
73 
76  static DtInteraction* create();
77 
80  static void addCallback(DtExerciseConn* conn,
81  DtCreateEntityInteractionCb cb, void* usr,
82  DtDDMRegionSP region = DtDDMRegionSP());
83  static void removeCallback(DtExerciseConn* conn,
84  DtCreateEntityInteractionCb cb, void* usr,
85  DtDDMRegionSP region = DtDDMRegionSP());
86 
87 protected:
88 
89  DtEntityIdentifier myOrigEnt;
90  DtEntityIdentifier myReceiveEnt;
91  int myRequestId;
92 };
93 
95 {
96  myOrigEnt = id;
97 }
98 
100 {
101  return myOrigEnt;
102 }
103 
105  const DtEntityIdentifier& id)
106 {
107  myReceiveEnt = id;
108 }
109 
111 {
112  return myReceiveEnt;
113 }
114 
115 inline void DtCreateEntityInteraction::setRequestId(int id)
116 {
117  myRequestId = id;
118 }
119 
120 inline int DtCreateEntityInteraction::requestId() const
121 {
122  return myRequestId;
123 }
124 
125 inline const char* DtCreateEntityInteraction::name() const
126 {
127  return "DtCreateEntityInteraction";
128 }
129 
130 #endif
131 #endif
132 
133 
DtInteraction is an base class for representing DIS PDUs which don&#39;t have state.
Definition: interactionDIS.h:24
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
Instances of DtCreateEntityPdu are used to send/receive create entity PDUs.
Definition: createEntityPdu.h:29
DtCreateEntityPdu DtCreateEntityInteraction
Definition: createEntityPdu.h:20
int requestId() const
Set/Get the request id.
virtual void setSenderId(const DtEntityIdentifier &id)
Set the sender ID.
virtual void setReceiverId(const DtEntityIdentifier &id)
Set the receiver ID.
This file defines math constants and methods which may be useful in simulations.
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
This file is deprecated - Please see simulationAddress.h, entityIdentifier.h, entityType.h, burstDescriptor.h, and NetStructs.h.
virtual const DtEntityIdentifier & senderId() const
Get the sender ID.
virtual const DtEntityIdentifier & receiverId() const
Get the receiver ID.
void setRequestId(int id)

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)