VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
serviceRequestInteractionHLA.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 serviceRequestInteractionHLA_H_
8 #define serviceRequestInteractionHLA_H_
9 
10 #if DtHLA
11 
12 #include "interactionWithEncDec.h"
13 #include "hostStructs.h"
14 #include <matrix/vlMath.h>
15 
16 
17 #include "packets/logisticsP.h"
18 
22 
23 #define DtSUPPLY_VALID 1
24 #define DtSUPPLY_BAD_INDEX 0
25 
28 
29 
30 
32 typedef void (*DtServiceRequestInteractionCb)
33  (DtServiceRequestInteraction* inter, void* usr);
34 
39 
41 {
42 public:
43 
46 
48  virtual ~DtServiceRequestInteraction();
49 
52 
55  const DtServiceRequestInteraction& orig);
56 
58  virtual void printData() const;
59 
61  virtual void printDataToStream(std::ostream& stream) const;
62 
64  virtual void setRequestingId(const DtGlobalObjectDesignator &requester);
65  virtual const DtGlobalObjectDesignator &requestingId() const;
66 
68  virtual void setServicingId(const DtGlobalObjectDesignator &servicer);
69  virtual const DtGlobalObjectDesignator &servicingId() const;
70 
72  virtual void setServiceType(DtServiceType type);
73  virtual DtServiceType serviceType() const;
74 
76  virtual void setSupplies(const void* data, int numBytes);
77  virtual const void* supplies() const;
78 
80  virtual void setNumSupplyTypes(int numTypes);
81  virtual int numSupplyTypes() const;
82 
83  virtual void setNthSupply(int supplyIndex, const DtEntityType &supply,
84  float quantity, int *retCode = NULL);
85  virtual const DtEntityType& nthSupply(int supplyIndex,
86  float *quantity = NULL, int *retCode = NULL) const;
87 
88  virtual float supplyQuantity(const DtEntityType &supply) const;
89 
90  virtual void changeSuppliesSize(int newSize);
91 
92  virtual int indexInBounds(int ind) const;
93 
94 
95 
97  virtual const char* name() const;
98 
99 public:
100 
103  static DtInteraction* create();
104 
107  static void addCallback(DtExerciseConn* conn,
108  DtServiceRequestInteractionCb cb, void* usr,
109  DtDDMRegionSP region = DtDDMRegionSP());
110  static void removeCallback(DtExerciseConn* conn,
111  DtServiceRequestInteractionCb cb, void* usr,
112  DtDDMRegionSP region = DtDDMRegionSP());
113 
114 protected:
115 
122 };
123 
126 {
127  return myRequestingObject;
128 }
129 
132 {
133  return myServicingObject;
134 }
135 
137 {
138  return myServiceType;
139 }
140 
142  const DtGlobalObjectDesignator &id)
143 {
144  myServicingObject = id;
145 }
146 
148  const DtGlobalObjectDesignator &id)
149 {
150  myRequestingObject = id;
151 }
152 
154 {
155  myServiceType = type;
156 }
157 
158 inline const char* DtServiceRequestInteraction::name() const
159 {
160  return "DtServiceRequestInteraction";
161 }
162 
163 #endif
164 #endif
165 
DtInteraction is an abstract base class for representing HLA interactions (or events) (as opposed to ...
Definition: interactionHLA.h:33
DtServiceType
Definition: disEnums.h:376
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:58
DtInteractionWithEncDec & operator=(const DtInteractionWithEncDec &orig)
assignment operator
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
This file declares classes for the Logistics PDUs.
Definition: logisticsP.h:18
DtEntityType myNthSupply
Definition: serviceRequestInteractionHLA.h:121
virtual void setServicingId(const DtGlobalObjectDesignator &servicer)
Set/Get the repairing object.
Definition: serviceRequestInteractionHLA.h:141
DtNetSupplyQuantity * mySupplies
Definition: serviceRequestInteractionHLA.h:120
static void removeCallback(DtExerciseConn *conn, const std::set< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
DtGlobalObjectDesignator myRequestingObject
Definition: serviceRequestInteractionHLA.h:116
class DtServiceRequestInteraction:
Definition: serviceRequestInteractionHLA.h:40
virtual void setServiceType(DtServiceType type)
Set/Get the service type.
Definition: serviceRequestInteractionHLA.h:153
This file defines math constants and methods which may be useful in simulations.
virtual void printData() const
Print the interaction&#39;s data to DtInfo.
Definition: interactionHLA.h:348
virtual void printDataToStream(std::ostream &stream) const
Print the interaction&#39;s data to the stream.
Definition: interactionHLA.h:356
virtual const char * name() const =0
Name of the interaction. (Not necessarily the ClassName from the FOM.)
DtServiceType myServiceType
Definition: serviceRequestInteractionHLA.h:118
virtual const DtGlobalObjectDesignator & servicingId() const
Definition: serviceRequestInteractionHLA.h:131
static void addCallback(DtExerciseConn *conn, const std::set< DtString > *classes, DtReceiveInteractionCb cb, void *usr, DtDDMRegionSP region=DtDDMRegionSP())
Register/Deregister callback function cb with conn, on all interaction class name (char*) contained i...
void(* DtServiceRequestInteractionCb)(DtServiceRequestInteraction *inter, void *usr)
ServiceRequest interaction callback function signature.
Definition: serviceRequestInteractionHLA.h:33
DtGlobalObjectDesignator myServicingObject
Definition: serviceRequestInteractionHLA.h:117
int myNumSupplyTypes
Definition: serviceRequestInteractionHLA.h:119
DtBoost::shared_ptr< DtDDMRegion > DtDDMRegionSP
Definition: region13.h:31
virtual const char * name() const
Name of the interaction. (Not necessarily the ClassName from the FOM.)
Definition: serviceRequestInteractionHLA.h:158
This file is deprecated - Please see simulationAddress.h, entityIdentifier.h, entityType.h, burstDescriptor.h, and NetStructs.h.
This file provides a declaration of the class DtInteractionWithEncDec.
virtual DtServiceType serviceType() const
Definition: serviceRequestInteractionHLA.h:136
class DtInteractionWithEncDec:
Definition: interactionWithEncDec.h:44
Instances of DtString are used to represent strings.
Definition: vlString.h:29
DtEntityType is used to represent the type an entity object.
Definition: entityType.h:26
virtual void setRequestingId(const DtGlobalObjectDesignator &requester)
Set/Get the receiving object.
Definition: serviceRequestInteractionHLA.h:147
virtual const DtGlobalObjectDesignator & requestingId() const
Definition: serviceRequestInteractionHLA.h:125

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)