KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IFF_Layer2.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: IFF_Layer2
32  DIS: (6) 1278.1A - 1998
33  created: 20/09/2013
34  author: Karl Jones
35 
36  purpose: Layer 2 emissions data.
37 
38  Size: 224 bits / 28 octets - min size
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./LayerHeader.h"
44 #include "./BeamData.h"
47 
48 namespace KDIS {
49 namespace DATA_TYPE {
50 
52 {
53 protected:
54 
56 
58 
59  std::vector<IFF_ATC_NAVAIDS_FundamentalParameterData> m_vFPD;
60 
61 public:
62 
63  static const KUINT16 IFF_LAYER2_SIZE = 28; // Min size
64 
65  IFF_Layer2();
66 
67  IFF_Layer2( KDataStream & stream ) throw( KException );
68 
69  IFF_Layer2( const LayerHeader & H, KDataStream & stream ) throw( KException );
70 
71  IFF_Layer2( const BeamData & BD, const SecondaryOperationalData & SOD,
72  const std::vector<IFF_ATC_NAVAIDS_FundamentalParameterData> & FPD );
73 
74  virtual ~IFF_Layer2();
75 
76  //************************************
77  // FullName: KDIS::DATA_TYPE::IFF_Layer2::SetBeamData
78  // KDIS::DATA_TYPE::IFF_Layer2::GetBeamData
79  //!Description: Specifies beam specific data.
80  //! If the mainbeam antenna activity of the IFF emitting system before the next
81  //! IFF/ATC/NAVAIDS PDU update can be represented by a single beam, then a description of the beam
82  //! shall be entered in this record. If multiple beams would be required, then this record
83  //! shall be filled with zeroes.
84  // Parameter: const BeamData & BD
85  //************************************
86  void SetBeamData( const BeamData & BD );
87  const BeamData & GetBeamData() const;
88  BeamData & GetBeamData();
89 
90  //************************************
91  // FullName: KDIS::DATA_TYPE::IFF_Layer2::SetSecondaryOperationalData
92  // KDIS::DATA_TYPE::IFF_Layer2::GetSecondaryOperationalData
93  //!Description: Specifies secondary operational data for the IFF/ATC/NAVAIDS emitting system.
94  //! Note: This data type holds the number of Fundamental Parameter Data Sets, if you make a
95  //! change you will need to make sure the value stays correct.
96  // Parameter: const SecondaryOperationalData & SOD
97  //************************************
98  void SetSecondaryOperationalData( const SecondaryOperationalData & SOD );
99  const SecondaryOperationalData & GetSecondaryOperationalData() const;
100  SecondaryOperationalData & GetSecondaryOperationalData();
101 
102  //************************************
103  // FullName: KDIS::DATA_TYPE::IFF_Layer2::AddFundamentalParameterData
104  // KDIS::DATA_TYPE::IFF_Layer2::SetFundamentalParameterData
105  // KDIS::DATA_TYPE::IFF_Layer2::GetFundamentalParameterData
106  //!Description: Specifies the values of the fundamental energy radiation characteristic
107  //! of each emission from the IFF/ATC/NAVAIDS emitting system.
108  // Parameter: const IFF_ATC_NAVAIDS_FundamentalParameterData & FPD, const vector<IFF_ATC_NAVAIDS_FundamentalParameterData> & FPD
109  //************************************
110  void AddFundamentalParameterData( const KDIS::DATA_TYPE::IFF_ATC_NAVAIDS_FundamentalParameterData & FPD );
111  void SetFundamentalParameterData( const std::vector<KDIS::DATA_TYPE::IFF_ATC_NAVAIDS_FundamentalParameterData> & FPD );
112  const std::vector<KDIS::DATA_TYPE::IFF_ATC_NAVAIDS_FundamentalParameterData> & GetFundamentalParameterData() const;
113 
114  //************************************
115  // FullName: KDIS::DATA_TYPE::IFF_Layer2::GetAsString
116  //!Description: Returns a string representation
117  //************************************
118  virtual KString GetAsString() const;
119 
120  //************************************
121  // FullName: KDIS::DATA_TYPE::IFF_Layer2::Decode
122  //!Description: Convert From Network Data.
123  // Parameter: KDataStream & stream
124  // Parameter: bool ignoreHeader = false - Decode the layer header from the stream?
125  //************************************
126  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
127 
128  //************************************
129  // FullName: KDIS::DATA_TYPE::IFF_Layer2::Encode
130  //!Description: Convert To Network Data.
131  // Parameter: KDataStream & stream
132  //************************************
133  virtual KDataStream Encode() const;
134  virtual void Encode( KDataStream & stream ) const;
135 
136  KBOOL operator == ( const IFF_Layer2 & Value ) const;
137  KBOOL operator != ( const IFF_Layer2 & Value ) const;
138 };
139 
140 } // END namespace DATA_TYPE
141 } // END namespace KDIS
Definition: BeamData.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: LayerHeader.h:59
BeamData m_BmDt
Definition: IFF_Layer2.h:55
Definition: IFF_ATC_NAVAIDS_FundamentalParameterData.h:48
std::vector< IFF_ATC_NAVAIDS_FundamentalParameterData > m_vFPD
Definition: IFF_Layer2.h:59
Definition: KDefines.h:182
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: SecondaryOperationalData.h:48
SecondaryOperationalData m_SOD
Definition: IFF_Layer2.h:57
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: IFF_Layer2.h:51