open-dis-cpp
EntityDamageStatusPdu.h
1 #pragma once
2 
3 #include <dis7/EntityID.h>
4 #include <dis7/DirectedEnergyDamage.h>
5 #include <vector>
6 #include <dis7/WarfareFamilyPdu.h>
7 #include <dis7/utils/DataStream.h>
8 #include <dis7/opendis7_export.h>
9 
10 
11 namespace DIS
12 {
13 // shall be used to communicate detailed damage information sustained by an entity regardless of the source of the damage Section 7.3.5 COMPLETE
14 
15 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
16 //
17 // @author DMcG, jkg
18 
19 class OPENDIS7_EXPORT EntityDamageStatusPdu : public WarfareFamilyPdu
20 {
21 protected:
24 
26  unsigned short _padding1;
27 
29  unsigned short _padding2;
30 
32  unsigned short _numberOfDamageDescription;
33 
35  std::vector<DirectedEnergyDamage> _damageDescriptionRecords;
36 
37 
38  public:
40  virtual ~EntityDamageStatusPdu();
41 
42  virtual void marshal(DataStream& dataStream) const;
43  virtual void unmarshal(DataStream& dataStream);
44 
45  EntityID& getDamagedEntityID();
46  const EntityID& getDamagedEntityID() const;
47  void setDamagedEntityID(const EntityID &pX);
48 
49  unsigned short getPadding1() const;
50  void setPadding1(unsigned short pX);
51 
52  unsigned short getPadding2() const;
53  void setPadding2(unsigned short pX);
54 
55  unsigned short getNumberOfDamageDescription() const;
56 
57  std::vector<DirectedEnergyDamage>& getDamageDescriptionRecords();
58  const std::vector<DirectedEnergyDamage>& getDamageDescriptionRecords() const;
59  void setDamageDescriptionRecords(const std::vector<DirectedEnergyDamage>& pX);
60 
61 
62 virtual int getMarshalledSize() const;
63 
64  bool operator ==(const EntityDamageStatusPdu& rhs) const;
65 };
66 }
67 
68 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
69 // Redistribution and use in source and binary forms, with or without
70 // modification, are permitted provided that the following conditions
71 // are met:
72 //
73 // * Redistributions of source code must retain the above copyright
74 // notice, this list of conditions and the following disclaimer.
75 // * Redistributions in binary form must reproduce the above copyright
76 // notice, this list of conditions and the following disclaimer
77 // in the documentation and/or other materials provided with the
78 // distribution.
79 // * Neither the names of the Naval Postgraduate School (NPS)
80 // Modeling Virtual Environments and Simulation (MOVES) Institute
81 // (http://www.nps.edu and http://www.MovesInstitute.org)
82 // nor the names of its contributors may be used to endorse or
83 // promote products derived from this software without specific
84 // prior written permission.
85 //
86 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
87 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
88 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
89 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
90 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
91 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
92 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
93 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
94 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
95 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
96 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
97 // POSSIBILITY OF SUCH DAMAGE.
EntityID _damagedEntityID
Field shall identify the damaged entity (see 6.2.28), Section 7.3.4 COMPLETE.
Definition: EntityDamageStatusPdu.h:23
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
a class to support managing a network buffer.
Definition: DataStream.h:28
std::vector< DirectedEnergyDamage > _damageDescriptionRecords
Fields shall contain one or more Damage Description records (see 6.2.17) and may contain other Standa...
Definition: EntityDamageStatusPdu.h:35
Definition: EntityDamageStatusPdu.h:19
unsigned short _numberOfDamageDescription
field shall specify the number of Damage Description records, Section 7.3.5
Definition: EntityDamageStatusPdu.h:32
Definition: WarfareFamilyPdu.h:18
Definition: EntityID.h:15
unsigned short _padding1
Padding.
Definition: EntityDamageStatusPdu.h:26
unsigned short _padding2
Padding.
Definition: EntityDamageStatusPdu.h:29