KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Entity_Damage_Status_PDU.h
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
29 
30 /********************************************************************
31  class: Entity_Damage_Status_PDU
32  DIS: (7) 1278.1-2012
33  created: 27/07/2011
34  author: Karl Jones
35 
36  purpose: Used to communicate detailed damage information sustained by an entity regardless
37  of the source of the damage.
38  The cause of the damage may be a weapon fired at the entity, a collision with
39  another object, or some other reason. The Entity Damage Status PDU enables damage
40  to a specific location on an entity to be conveyed whether or not that location
41  is associated with an articulated or attached part.
42  The information conveyed in this PDU augments damage information communicated in
43  the Entity State and other PDUs.
44 
45  Size: 192 bits / 24 octets - Min size
46 *********************************************************************/
47 
48 #pragma once
49 
50 #include "./../Header.h"
51 #include "./../../DataTypes/EntityIdentifier.h"
52 #include "./../../DataTypes/StandardVariable.h"
53 
54 namespace KDIS {
55 namespace PDU {
56 
58 {
59 protected:
60 
62 
64 
66 
67  std::vector<KDIS::DATA_TYPE::StdVarPtr> m_vDdRec;
68 
69 public:
70 
71  static const KUINT16 ENTITY_DAMAGE_STATE_PDU = 24; // Min size
72 
74 
75  Entity_Damage_Status_PDU( KDataStream & stream ) throw( KException );
76 
77  Entity_Damage_Status_PDU( const Header & H, KDataStream & stream ) throw( KException );
78 
80 
81  virtual ~Entity_Damage_Status_PDU();
82 
83  //************************************
84  // FullName: KDIS::PDU::Entity_Damage_Status_PDU::SetDamagedEntityID
85  // KDIS::PDU::Entity_Damage_Status_PDU::GetDamagedEntityID
86  //!Description: The damaged entity.
87  // Parameter: const EntityIdentifier & ID
88  //************************************
89  void SetDamagedEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
90  const KDIS::DATA_TYPE::EntityIdentifier & GetDamagedEntityID() const;
91  KDIS::DATA_TYPE::EntityIdentifier & GetDamagedEntityID();
92 
93  //************************************
94  // FullName: KDIS::PDU::Entity_Damage_Status_PDU::GetNumberOfDamageDescriptionRecords
95  //!Description: The Number of Damage Description records stored in this PDU.
96  //************************************
97  KUINT16 GetNumberOfDamageDescriptionRecords() const;
98 
99  //************************************
100  // FullName: KDIS::PDU::Directed_Energy_Fire_PDU::AddDamageDescriptionRecord
101  // KDIS::PDU::Directed_Energy_Fire_PDU::SetDamageDescriptionRecords
102  // KDIS::PDU::Directed_Energy_Fire_PDU::GetDamageDescriptionRecords
103  // KDIS::PDU::Directed_Energy_Fire_PDU::ClearDamageDescriptionRecords
104  //!Description: This field can contain one or more DD records and may also contain
105  // other Standard Variable records.
106  // Parameter: StdVarPtr DD, const vector<StdVarPtr> & DD
107  //************************************
108  void AddDamageDescriptionRecord( KDIS::DATA_TYPE::StdVarPtr DD );
109  void SetDamageDescriptionRecords( const std::vector<KDIS::DATA_TYPE::StdVarPtr> & DD );
110  const std::vector<KDIS::DATA_TYPE::StdVarPtr> & GetDamageDescriptionRecords() const;
111  void ClearDamageDescriptionRecords();
112 
113  //************************************
114  // FullName: KDIS::PDU::Entity_Damage_Status_PDU::GetAsString
115  //!Description: Returns a string representation of the PDU.
116  //************************************
117  virtual KString GetAsString() const;
118 
119  //************************************
120  // FullName: KDIS::PDU::Entity_Damage_Status_PDU::Decode
121  //!Description: Convert From Network Data.
122  // Parameter: KDataStream & stream
123  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
124  //************************************
125  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
126 
127  //************************************
128  // FullName: KDIS::PDU::Entity_Damage_Status_PDU::Encode
129  //!Description: Convert To Network Data.
130  // Parameter: KDataStream & stream
131  //************************************
132  virtual KDataStream Encode() const;
133  virtual void Encode( KDataStream & stream ) const;
134 
135  KBOOL operator == ( const Entity_Damage_Status_PDU & Value ) const;
136  KBOOL operator != ( const Entity_Damage_Status_PDU & Value ) const;
137 };
138 
139 } // END namespace PDU
140 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
KUINT32 m_ui32Padding
Definition: Entity_Damage_Status_PDU.h:63
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: Entity_Damage_Status_PDU.h:57
Definition: KDefines.h:182
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
Definition: Header7.h:142
KUINT16 m_ui16NumDmgDescRecs
Definition: Entity_Damage_Status_PDU.h:65
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: KRef_Ptr.h:73
KDIS::DATA_TYPE::EntityIdentifier m_DmgEnt
Definition: Entity_Damage_Status_PDU.h:61
std::vector< KDIS::DATA_TYPE::StdVarPtr > m_vDdRec
Definition: Entity_Damage_Status_PDU.h:67