open-dis-cpp
ServiceRequestPdu.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.1. Information about a request for supplies. 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 ServiceRequestPdu : public LogisticsFamilyPdu
21 {
22 protected:
25 
28 
30  unsigned char _serviceTypeRequested;
31 
33  unsigned char _numberOfSupplyTypes;
34 
37 
38  std::vector<SupplyQuantity> _supplies;
39 
40 
41  public:
43  virtual ~ServiceRequestPdu();
44 
45  virtual void marshal(DataStream& dataStream) const;
46  virtual void unmarshal(DataStream& dataStream);
47 
48  EntityID& getRequestingEntityID();
49  const EntityID& getRequestingEntityID() const;
50  void setRequestingEntityID(const EntityID &pX);
51 
52  EntityID& getServicingEntityID();
53  const EntityID& getServicingEntityID() const;
54  void setServicingEntityID(const EntityID &pX);
55 
56  unsigned char getServiceTypeRequested() const;
57  void setServiceTypeRequested(unsigned char pX);
58 
59  unsigned char getNumberOfSupplyTypes() const;
60 
61  short getServiceRequestPadding() const;
62  void setServiceRequestPadding(short 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 ServiceRequestPdu& 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.
Definition: ServiceRequestPdu.h:20
short _serviceRequestPadding
padding
Definition: ServiceRequestPdu.h:36
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned char _serviceTypeRequested
type of service requested
Definition: ServiceRequestPdu.h:30
a class to support managing a network buffer.
Definition: DataStream.h:28
Definition: LogisticsFamilyPdu.h:16
Definition: EntityID.h:15
EntityID _requestingEntityID
Entity that is requesting service.
Definition: ServiceRequestPdu.h:24
unsigned char _numberOfSupplyTypes
How many requested.
Definition: ServiceRequestPdu.h:33
EntityID _servicingEntityID
Entity that is providing the service.
Definition: ServiceRequestPdu.h:27