VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
resupplyRecInteraction.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 resupplyRecInteraction_H_
8 #define resupplyRecInteraction_H_
9 
10 #if DtHLA
11 
12 #include "interactionWithEncDec.h"
13 #include "hostStructs.h"
14 #include <matrix/vlMath.h>
15 #include "packets/logisticsP.h"
16 
17 
18 
22 
23 #define DtSUPPLY_VALID 1
24 #define DtSUPPLY_BAD_INDEX 0
25 
28 
29 
31 typedef void (*DtResupplyRecInteractionCb)
32  (DtResupplyRecInteraction* inter, void* usr);
33 
34 
39 
41 {
42 public:
43 
46 
48  virtual ~DtResupplyRecInteraction();
49 
52 
55 
57  virtual void printData() const;
58 
60  virtual void printDataToStream(std::ostream& stream) const;
61 
63  virtual void setReceivingId(const DtGlobalObjectDesignator &requester);
64  virtual const DtGlobalObjectDesignator &receivingId() const;
65 
67  virtual void setSupplyingId(const DtGlobalObjectDesignator &servicer);
68  virtual const DtGlobalObjectDesignator &supplyingId() const;
69 
71  virtual void setSupplies(const void* data, int numBytes);
72  virtual const void* supplies() const;
73 
75  virtual void setNumSupplyTypes(int numTypes);
76  virtual int numSupplyTypes() const;
77 
78  virtual void setNthSupply(int supplyIndex, const DtEntityType &supply,
79  float quantity, int *retCode = NULL);
80  virtual const DtEntityType &nthSupply(int supplyIndex,
81  float *quantity = NULL,
82  int *retCode = NULL) const;
83 
84  virtual float supplyQuantity(const DtEntityType &supply) const;
85 
86  virtual void changeSuppliesSize(int newSize);
87 
88  virtual int indexInBounds(int ind) const;
89 
91  virtual const char* name() const;
92 
93 public:
94 
97  static DtInteraction* create();
98 
101  static void addCallback(DtExerciseConn* conn,
102  DtResupplyRecInteractionCb cb, void* usr,
103  DtDDMRegionSP region = DtDDMRegionSP());
104  static void removeCallback(DtExerciseConn* conn,
105  DtResupplyRecInteractionCb cb, void* usr,
106  DtDDMRegionSP region = DtDDMRegionSP());
107 
108 protected:
109 
115 };
116 
119 {
120  return myReceivingObject;
121 }
122 
125 {
126  return mySupplyingObject;
127 }
128 
130  const DtGlobalObjectDesignator &id)
131 {
132  myReceivingObject = id;
133 }
134 
136  const DtGlobalObjectDesignator &id)
137 {
138  mySupplyingObject = id;
139 }
140 
141 inline const char* DtResupplyRecInteraction::name() const
142 {
143  return "DtResupplyRecInteraction";
144 }
145 
146 #endif
147 #endif
148 

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)