open-dis-cpp
EventReportReliablePdu.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.11: reports the occurance of a significatnt event to the simulation manager. Needs manual intervention to fix padding in variable datums. UNFINISHED.
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 short _eventType;
24 
26  unsigned int _pad1;
27 
30 
33 
35  std::vector<FixedDatum> _fixedDatumRecords;
36 
38  std::vector<VariableDatum> _variableDatumRecords;
39 
40 
41  public:
43  virtual ~EventReportReliablePdu();
44 
45  virtual void marshal(DataStream& dataStream) const;
46  virtual void unmarshal(DataStream& dataStream);
47 
48  unsigned short getEventType() const;
49  void setEventType(unsigned short pX);
50 
51  unsigned int getPad1() const;
52  void setPad1(unsigned int pX);
53 
54  unsigned int getNumberOfFixedDatumRecords() const;
55 
56  unsigned int getNumberOfVariableDatumRecords() const;
57 
58  std::vector<FixedDatum>& getFixedDatumRecords();
59  const std::vector<FixedDatum>& getFixedDatumRecords() const;
60  void setFixedDatumRecords(const std::vector<FixedDatum>& pX);
61 
62  std::vector<VariableDatum>& getVariableDatumRecords();
63  const std::vector<VariableDatum>& getVariableDatumRecords() const;
64  void setVariableDatumRecords(const std::vector<VariableDatum>& pX);
65 
66 
67 virtual int getMarshalledSize() const;
68 
69  bool operator ==(const EventReportReliablePdu& rhs) const;
70 };
71 }
72 
73 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
74 // Redistribution and use in source and binary forms, with or without
75 // modification, are permitted provided that the following conditions
76 // are met:
77 //
78 // * Redistributions of source code must retain the above copyright
79 // notice, this list of conditions and the following disclaimer.
80 // * Redistributions in binary form must reproduce the above copyright
81 // notice, this list of conditions and the following disclaimer
82 // in the documentation and/or other materials provided with the
83 // distribution.
84 // * Neither the names of the Naval Postgraduate School (NPS)
85 // Modeling Virtual Environments and Simulation (MOVES) Institute
86 // (http://www.nps.edu and http://www.MovesInstitute.org)
87 // nor the names of its contributors may be used to endorse or
88 // promote products derived from this software without specific
89 // prior written permission.
90 //
91 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
92 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
93 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
94 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
95 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
96 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
97 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
98 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
99 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
100 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
101 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
102 // 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
std::vector< VariableDatum > _variableDatumRecords
Variable datum records.
Definition: EventReportReliablePdu.h:38
unsigned int _numberOfFixedDatumRecords
Fixed datum record count.
Definition: EventReportReliablePdu.h:29
unsigned short _eventType
Event type.
Definition: EventReportReliablePdu.h:23
std::vector< FixedDatum > _fixedDatumRecords
Fixed datum records.
Definition: EventReportReliablePdu.h:35
Definition: EventReportReliablePdu.h:19
unsigned int _pad1
padding
Definition: EventReportReliablePdu.h:26
unsigned int _numberOfVariableDatumRecords
variable datum record count
Definition: EventReportReliablePdu.h:32