KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Electromagnetic_Emission_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: Electromagnetic_Emission_PDU
32  DIS: (5) 1278.1 - 1995
33  created: 2008/10/19
34  author: Karl Jones
35 
36  purpose: Contains infomation about electronic warfare (EW) emissions and
37  active EW countermeasure.
38 
39  Size: 224 bits / 28 octets - min size
40 *********************************************************************/
41 
42 #pragma once
43 
44 #include "./../Header.h"
45 #include "./../../DataTypes/EntityIdentifier.h"
46 #include "./../../DataTypes/EmissionSystem.h"
47 #include <vector>
48 
49 namespace KDIS {
50 namespace PDU {
51 
53 {
54 protected:
55 
57 
59 
61 
63 
65 
66  std::vector<KDIS::DATA_TYPE::EmissionSystem> m_vEmissionSystem;
67 
68 public:
69 
70  static const KUINT16 ELECTROMAGNETIC_EMISSION_PDU_SIZE = 28; // Min Size
71 
73 
75 
76  Electromagnetic_Emission_PDU( const Header & H, KDataStream & stream ) throw( KException );
77 
80 
82  KDIS::DATA_TYPE::ENUMS::StateUpdateIndicator SUI, const std::vector<KDIS::DATA_TYPE::EmissionSystem> & EmissionSystems );
83 
85 
86  //************************************
87  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::SetEmittingEntityID
88  // KDIS::PDU::Electromagnetic_Emission_PDU::GetEmittingEntityID
89  //!Description: Emitting Entity ID
90  // Parameter: const EntityIdentifier & ID
91  //************************************
92  void SetEmittingEntityID ( const KDIS::DATA_TYPE::EntityIdentifier & ID );
93  const KDIS::DATA_TYPE::EntityIdentifier & GetEmittingEntityID() const;
94  KDIS::DATA_TYPE::EntityIdentifier & GetEmittingEntityID();
95 
96  //************************************
97  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::SetEventID
98  // KDIS::PDU::Electromagnetic_Emission_PDU::GetEventID
99  //!Description: Event ID. For associated events.
100  // Parameter: const EntityIdentifier & ID
101  //************************************
102  void SetEventID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
103  const KDIS::DATA_TYPE::EntityIdentifier & GetEventID() const;
104  KDIS::DATA_TYPE::EntityIdentifier & GetEventID();
105 
106  //************************************
107  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::SetStateUpdateIndicator
108  // KDIS::PDU::Electromagnetic_Emission_PDU::GetStateUpdateIndicator
109  //!Description: Indicates if the data contained in the PDU represents a state update or
110  //! just data that has changed since issuance of the last Electromagnetic Emission
111  //! PDU.
112  // Parameter: StateUpdateIndicator SUI
113  //************************************
114  void SetStateUpdateIndicator( KDIS::DATA_TYPE::ENUMS::StateUpdateIndicator SUI );
115  KDIS::DATA_TYPE::ENUMS::StateUpdateIndicator GetStateUpdateIndicator() const;
116 
117  //************************************
118  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::GetNumberOfEmissionSystems
119  //!Description: Returns number of emission system records
120  //************************************
121  KUINT8 GetNumberOfEmissionSystems() const;
122 
123  //************************************
124  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::AddEmissionSystem
125  // KDIS::PDU::Electromagnetic_Emission_PDU::SetEmissionSystem
126  // KDIS::PDU::Electromagnetic_Emission_PDU::GetEmissionSystems
127  // KDIS::PDU::Electromagnetic_Emission_PDU::ClearEmissionSystem
128  //!Description: Emissions systems belonging to the electromagnetic emission PDU.
129  // Parameter: const EmissionSystem & ES, const vector<EmissionSystem> & ES
130  //************************************
131  void AddEmissionSystem( const KDIS::DATA_TYPE::EmissionSystem & ES );
132  void SetEmissionSystem( const std::vector<KDIS::DATA_TYPE::EmissionSystem> & ES );
133  const std::vector<KDIS::DATA_TYPE::EmissionSystem> & GetEmissionSystems() const;
134  void ClearEmissionSystem();
135 
136  //************************************
137  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::GetAsString
138  //!Description: Returns a string representation of the PDU.
139  //************************************
140  virtual KString GetAsString() const;
141 
142  //************************************
143  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::Decode
144  //!Description: Convert From Network Data.
145  // Parameter: KDataStream & stream
146  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
147  //************************************
148  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
149 
150  //************************************
151  // FullName: KDIS::PDU::Electromagnetic_Emission_PDU::Encode
152  //!Description: Convert To Network Data.
153  // Parameter: KDataStream & stream
154  //************************************
155  virtual KDataStream Encode() const;
156  virtual void Encode( KDataStream & stream ) const;
157 
158  KBOOL operator == ( const Electromagnetic_Emission_PDU & Value ) const;
159  KBOOL operator != ( const Electromagnetic_Emission_PDU & Value ) const;
160 };
161 
162 } // END namespace PDU
163 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8NumberOfEmissionSystems
Definition: Electromagnetic_Emission_PDU.h:62
Definition: KDefines.h:182
KDIS::DATA_TYPE::EntityIdentifier m_EmittingEntityID
Definition: Electromagnetic_Emission_PDU.h:56
Definition: KDataStream.h:48
Definition: Electromagnetic_Emission_PDU.h:52
bool KBOOL
Definition: KDefines.h:119
KDIS::DATA_TYPE::EntityIdentifier m_EventID
Definition: Electromagnetic_Emission_PDU.h:58
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
KUINT16 m_ui16Padding
Definition: Electromagnetic_Emission_PDU.h:64
Definition: Header7.h:142
unsigned char KUINT8
Definition: KDefines.h:99
StateUpdateIndicator
Definition: EnumEmitter.h:1307
std::vector< KDIS::DATA_TYPE::EmissionSystem > m_vEmissionSystem
Definition: Electromagnetic_Emission_PDU.h:66
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: EmissionSystem.h:51
KUINT8 m_ui8StateUpdateIndicator
Definition: Electromagnetic_Emission_PDU.h:60