KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Warfare_Header.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: Fire_PDU
32  DIS: (5) 1278.1 - 1995
33  created: 2008/10/13
34  author: Karl Jones
35 
36  purpose: Warfare PDU family header
37  Size: 288 bits / 36 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./../Header.h"
43 #include "./../../DataTypes/EntityIdentifier.h"
44 
45 namespace KDIS {
46 namespace PDU {
47 
49 {
50 protected:
51 
53 
55 
57 
59 
60 public:
61 
62  static const KUINT16 WARFARE_HEADER_SIZE = 36;
63 
65 
66  Warfare_Header( const Header & H );
67 
70 
71  virtual ~Warfare_Header();
72 
73  //************************************
74  // FullName: KDIS::PDU::Warfare_Header::SetFiringEntityID
75  // KDIS::PDU::Warfare_Header::GetFiringEntityID
76  //!Description: Firing Entity.
77  // Parameter: const EntityIdentifier & ID
78  //************************************
79  void SetFiringEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
80  const KDIS::DATA_TYPE::EntityIdentifier & GetFiringEntityID() const;
81  KDIS::DATA_TYPE::EntityIdentifier & GetFiringEntityID();
82 
83  //************************************
84  // FullName: KDIS::PDU::Warfare_Header::SetTargetEntityID
85  // KDIS::PDU::Warfare_Header::GetTargetEntityID
86  //!Description: Target Entity. If target is unknown the ID
87  //! shall contain the symbolic value: TARGET_ID_UNKNOWN.
88  // Parameter: const EntityIdentifier & ID
89  //************************************
90  void SetTargetEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
91  const KDIS::DATA_TYPE::EntityIdentifier & GetTargetEntityID() const;
92  KDIS::DATA_TYPE::EntityIdentifier & GetTargetEntityID();
93 
94  //************************************
95  // FullName: KDIS::PDU::Warfare_Header::SetMunitionID
96  // KDIS::PDU::Warfare_Header::GetMunitionID
97  //!Description: Munition ID. If the munition is not tracked
98  //! the ID shall contain the symbolic value: MUNITION_NOT_TRACKED.
99  // Parameter: const EntityIdentifier & ID
100  //************************************
101  void SetMunitionID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
102  const KDIS::DATA_TYPE::EntityIdentifier & GetMunitionID() const;
103  KDIS::DATA_TYPE::EntityIdentifier & GetMunitionID();
104 
105  //************************************
106  // FullName: KDIS::PDU::Warfare_Header::SetEventID
107  // KDIS::PDU::Warfare_Header::GetEventID
108  //!Description: Event ID. Used to associate related firing/detonation
109  //! events. If a detonation event if not proceeded
110  //! by a firing event then the value shall be 0 (e.g land mines)
111  // Parameter: const EntityIdentifier & ID
112  //************************************
113  void SetEventID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
114  const KDIS::DATA_TYPE::EntityIdentifier & GetEventID() const;
115  KDIS::DATA_TYPE::EntityIdentifier & GetEventID();
116 
117  //************************************
118  // FullName: KDIS::PDU::Warfare_Header::GetAsString
119  //!Description: Returns a string representation of the PDU.
120  //************************************
121  virtual KString GetAsString() const;
122 
123  //************************************
124  // FullName: KDIS::PDU::Warfare_Header::Decode
125  //!Description: Convert From Network Data.
126  // Parameter: KDataStream & stream
127  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
128  //************************************
129  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
130 
131  //************************************
132  // FullName: KDIS::PDU::Warfare_Header::Encode
133  //!Description: Convert To Network Data.
134  // Parameter: KDataStream & stream
135  //************************************
136  virtual KDataStream Encode() const;
137  virtual void Encode( KDataStream & stream ) const;
138 
139  KBOOL operator == ( const Warfare_Header & Value ) const;
140  KBOOL operator != ( const Warfare_Header & Value ) const;
141 };
142 
143 } // END namespace PDU
144 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
KDIS::DATA_TYPE::EntityIdentifier m_EventID
Definition: Warfare_Header.h:58
KDIS::DATA_TYPE::EntityIdentifier m_TargetEntityID
Definition: Warfare_Header.h:54
Definition: KDefines.h:182
Definition: KDataStream.h:48
KDIS::DATA_TYPE::EntityIdentifier m_MunitionID
Definition: Warfare_Header.h:56
bool KBOOL
Definition: KDefines.h:119
Definition: Warfare_Header.h:48
KDIS::DATA_TYPE::EntityIdentifier m_FiringEntityID
Definition: Warfare_Header.h:52
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
Definition: Header7.h:142
Definition: EnumEntityManagement.h:561
#define KDIS_EXPORT
Definition: KDefines.h:82