VR-Link API Documentation for HLA 1516
hServReqInter.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 hServReqInter_H_
8 #define hServReqInter_H_
9 
10 #if DtHLA
11 
12 #include "hIntWEncDec.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 

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)