open-dis-cpp
DataReliablePdu.h
1 #pragma once
2 
3 #include <dis6/FixedDatum.h>
4 #include <dis6/VariableDatum.h>
5 #include <vector>
6 #include <dis6/SimulationManagementWithReliabilityFamilyPdu.h>
7 #include <dis6/utils/DataStream.h>
8 #include <dis6/opendis6_export.h>
9 
10 
11 namespace DIS
12 {
13 // Section 5.3.12.10: issued in response to a data query R or set dataR pdu. Needs manual intervention to fix padding on variable datums. UNFINSIHED
14 
15 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
16 //
17 // @author DMcG, jkg
18 
20 {
21 protected:
23  unsigned int _requestID;
24 
27 
29  unsigned short _pad1;
30 
32  unsigned char _pad2;
33 
36 
39 
41  std::vector<FixedDatum> _fixedDatumRecords;
42 
44  std::vector<VariableDatum> _variableDatumRecords;
45 
46 
47  public:
49  virtual ~DataReliablePdu();
50 
51  virtual void marshal(DataStream& dataStream) const;
52  virtual void unmarshal(DataStream& dataStream);
53 
54  unsigned int getRequestID() const;
55  void setRequestID(unsigned int pX);
56 
57  unsigned char getRequiredReliabilityService() const;
58  void setRequiredReliabilityService(unsigned char pX);
59 
60  unsigned short getPad1() const;
61  void setPad1(unsigned short pX);
62 
63  unsigned char getPad2() const;
64  void setPad2(unsigned char pX);
65 
66  unsigned int getNumberOfFixedDatumRecords() const;
67 
68  unsigned int getNumberOfVariableDatumRecords() const;
69 
70  std::vector<FixedDatum>& getFixedDatumRecords();
71  const std::vector<FixedDatum>& getFixedDatumRecords() const;
72  void setFixedDatumRecords(const std::vector<FixedDatum>& pX);
73 
74  std::vector<VariableDatum>& getVariableDatumRecords();
75  const std::vector<VariableDatum>& getVariableDatumRecords() const;
76  void setVariableDatumRecords(const std::vector<VariableDatum>& pX);
77 
78 
79 virtual int getMarshalledSize() const;
80 
81  bool operator ==(const DataReliablePdu& rhs) const;
82 };
83 }
84 
85 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
86 // Redistribution and use in source and binary forms, with or without
87 // modification, are permitted provided that the following conditions
88 // are met:
89 //
90 // * Redistributions of source code must retain the above copyright
91 // notice, this list of conditions and the following disclaimer.
92 // * Redistributions in binary form must reproduce the above copyright
93 // notice, this list of conditions and the following disclaimer
94 // in the documentation and/or other materials provided with the
95 // distribution.
96 // * Neither the names of the Naval Postgraduate School (NPS)
97 // Modeling Virtual Environments and Simulation (MOVES) Institute
98 // (http://www.nps.edu and http://www.MovesInstitute.org)
99 // nor the names of its contributors may be used to endorse or
100 // promote products derived from this software without specific
101 // prior written permission.
102 //
103 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
104 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
105 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
106 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
107 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
108 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
109 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
110 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
111 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
112 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
113 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
114 // POSSIBILITY OF SUCH DAMAGE.
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
Definition: SimulationManagementWithReliabilityFamilyPdu.h:18
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned char _requiredReliabilityService
level of reliability service used for this transaction
Definition: DataReliablePdu.h:26
unsigned int _numberOfFixedDatumRecords
Fixed datum record count.
Definition: DataReliablePdu.h:35
unsigned int _requestID
Request ID.
Definition: DataReliablePdu.h:23
std::vector< VariableDatum > _variableDatumRecords
Variable datum records.
Definition: DataReliablePdu.h:44
Definition: DataReliablePdu.h:19
unsigned char _pad2
padding
Definition: DataReliablePdu.h:32
std::vector< FixedDatum > _fixedDatumRecords
Fixed datum records.
Definition: DataReliablePdu.h:41
unsigned int _numberOfVariableDatumRecords
variable datum record count
Definition: DataReliablePdu.h:38
unsigned short _pad1
padding
Definition: DataReliablePdu.h:29