open-dis-cpp
ResupplyReceivedPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityID.h>
5 #include <dis6/SupplyQuantity.h>
6 #include <vector>
7 #include <dis6/LogisticsFamilyPdu.h>
8 #include <dis6/utils/DataStream.h>
9 #include <dis6/opendis6_export.h>
10 
11 
12 namespace DIS
13 {
14 // Section 5.3.5.3. Receipt of supplies is communiated. COMPLETE
15 
16 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
17 //
18 // @author DMcG, jkg
19 
20 class OPENDIS6_EXPORT ResupplyReceivedPdu : public LogisticsFamilyPdu
21 {
22 protected:
25 
28 
30  unsigned char _numberOfSupplyTypes;
31 
33  short _padding1;
34 
36  char _padding2;
37 
38  std::vector<SupplyQuantity> _supplies;
39 
40 
41  public:
43  virtual ~ResupplyReceivedPdu();
44 
45  virtual void marshal(DataStream& dataStream) const;
46  virtual void unmarshal(DataStream& dataStream);
47 
48  EntityID& getReceivingEntityID();
49  const EntityID& getReceivingEntityID() const;
50  void setReceivingEntityID(const EntityID &pX);
51 
52  EntityID& getSupplyingEntityID();
53  const EntityID& getSupplyingEntityID() const;
54  void setSupplyingEntityID(const EntityID &pX);
55 
56  unsigned char getNumberOfSupplyTypes() const;
57 
58  short getPadding1() const;
59  void setPadding1(short pX);
60 
61  char getPadding2() const;
62  void setPadding2(char pX);
63 
64  std::vector<SupplyQuantity>& getSupplies();
65  const std::vector<SupplyQuantity>& getSupplies() const;
66  void setSupplies(const std::vector<SupplyQuantity>& pX);
67 
68 
69 virtual int getMarshalledSize() const;
70 
71  bool operator ==(const ResupplyReceivedPdu& rhs) const;
72 };
73 }
74 
75 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
76 // Redistribution and use in source and binary forms, with or without
77 // modification, are permitted provided that the following conditions
78 // are met:
79 //
80 // * Redistributions of source code must retain the above copyright
81 // notice, this list of conditions and the following disclaimer.
82 // * Redistributions in binary form must reproduce the above copyright
83 // notice, this list of conditions and the following disclaimer
84 // in the documentation and/or other materials provided with the
85 // distribution.
86 // * Neither the names of the Naval Postgraduate School (NPS)
87 // Modeling Virtual Environments and Simulation (MOVES) Institute
88 // (http://www.nps.edu and http://www.MovesInstitute.org)
89 // nor the names of its contributors may be used to endorse or
90 // promote products derived from this software without specific
91 // prior written permission.
92 //
93 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
94 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
95 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
96 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
97 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
98 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
99 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
100 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
101 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
102 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
103 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
104 // POSSIBILITY OF SUCH DAMAGE.
EntityID _receivingEntityID
Entity that is receiving service.
Definition: ResupplyReceivedPdu.h:24
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned char _numberOfSupplyTypes
how many supplies are being offered
Definition: ResupplyReceivedPdu.h:30
Definition: LogisticsFamilyPdu.h:16
char _padding2
padding
Definition: ResupplyReceivedPdu.h:36
Definition: EntityID.h:15
Definition: ResupplyReceivedPdu.h:20
short _padding1
padding
Definition: ResupplyReceivedPdu.h:33
std::vector< SupplyQuantity > _supplies
Type and amount of supplies for each specified supply type.
Definition: ResupplyReceivedPdu.h:38
EntityID _supplyingEntityID
Entity that is supplying.
Definition: ResupplyReceivedPdu.h:27