KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SystemIdentifier.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: SystemIdentifier
32  created: 05/12/2008
33  author: Karl Jones
34 
35  purpose: Identifier for IFF/ATC/NAVADIS systems.
36  Shall specify the change status of the PDU,
37  the system type, name and mode.
38  size: 48 bits / 6 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./DataTypeBase.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
55 
57 
58  union
59  {
60  struct
61  {
62  KUINT8 m_ui8ChangeIndicator : 1;
63  KUINT8 m_ui8AltMode4 : 1;
64  KUINT8 m_ui8AltModeC : 1;
65  // Bits 3-7 not used
66  };
67 
69  };
70 
71 public:
72 
73  static const KUINT16 SYSTEM_IDENTIFER_SIZE = 6;
74 
76 
78  KBOOL ChangeIndicator, KBOOL AltMode4 = false, KBOOL AltModeC = false );
79 
80  SystemIdentifier( KDataStream & stream ) throw( KException );
81 
82  virtual ~SystemIdentifier();
83 
84  //************************************
85  // FullName: KDIS::DATA_TYPE::SystemIdentifier::SetSystemType
86  // KDIS::DATA_TYPE::SystemIdentifier::GetSystemType
87  //!Description: System Type
88  // Parameter: SystemType T
89  //************************************
90  void SetSystemType( KDIS::DATA_TYPE::ENUMS::SystemType T );
91  KDIS::DATA_TYPE::ENUMS::SystemType GetSystemType() const;
92 
93  //************************************
94  // FullName: KDIS::DATA_TYPE::SystemIdentifier::SetSystemName
95  // KDIS::DATA_TYPE::SystemIdentifier::GetSystemName
96  //!Description: A particular named type of system
97  // Parameter: SystemName ID
98  //************************************
99  void SetSystemName( KDIS::DATA_TYPE::ENUMS::SystemName N );
100  KDIS::DATA_TYPE::ENUMS::SystemName GetSystemName() const;
101 
102  //************************************
103  // FullName: KDIS::DATA_TYPE::SystemIdentifier::SetSystemMode
104  // KDIS::DATA_TYPE::SystemIdentifier::GetSystemMode
105  //!Description: Mode of operation for the named system.
106  // Parameter: SystemMode M
107  //************************************
108  void SetSystemMode( KDIS::DATA_TYPE::ENUMS::SystemMode M );
109  KDIS::DATA_TYPE::ENUMS::SystemMode GetSystemMode() const;
110 
111  //************************************
112  // FullName: KDIS::DATA_TYPE::SystemIdentifier::SetChangeOptions
113  // KDIS::DATA_TYPE::SystemIdentifier::GetChangeOptions
114  //!Description: Used to specifiy the status of the PDU(existence of
115  //! changes from previous indicators for alternative fields etc).
116  //! Note: Alternative Mode 4 and Alternative Mode C changes
117  //! only apply to Mark X/XII/ATCRBS/MODE S Transponder and
118  //! Mark X/XII/ATCRBS/MODE S Interrogator systems.
119  // Parameter: KBOOL ChangeIndicator
120  // Parameter: KBOOL AltMode4
121  // Parameter: KBOOL AltModeC
122  //************************************
123  void SetChangeOptions( KBOOL ChangeIndicator, KBOOL AltMode4, KBOOL AltModeC );
124  void SetChangeIndicator( KBOOL CI );
125  void SetAltMode4( KBOOL AM );
126  void SetAltModeC( KBOOL AM );
127  KBOOL GetChangeIndicator() const;
128  KBOOL GetAltMode4() const;
129  KBOOL GetAltModeC() const;
130 
131  //************************************
132  // FullName: KDIS::DATA_TYPE::SystemIdentifier::GetAsString
133  //!Description: Returns a string representation
134  //************************************
135  virtual KString GetAsString() const;
136 
137  //************************************
138  // FullName: KDIS::SystemIdentifier::DataTypeBase::Decode
139  //!Description: Convert From Network Data.
140  // Parameter: KDataStream & stream
141  //************************************
142  virtual void Decode( KDataStream & stream ) throw( KException );
143 
144  //************************************
145  // FullName: KDIS::DATA_TYPE::SystemIdentifier::Encode
146  //!Description: Convert To Network Data.
147  // Parameter: KDataStream & stream
148  //************************************
149  virtual KDataStream Encode() const;
150  virtual void Encode( KDataStream & stream ) const;
151 
152  KBOOL operator == ( const SystemIdentifier & Value ) const;
153  KBOOL operator != ( const SystemIdentifier & Value ) const;
154 };
155 
156 } // END namespace DATA_TYPES
157 } // END namespace KDIS
158 
KUINT16 m_ui16SystemType
Definition: SystemIdentifier.h:52
SystemType
Definition: EnumSystemIdentifier.h:54
unsigned short int KUINT16
Definition: KDefines.h:101
SystemName
Definition: EnumSystemIdentifier.h:77
Definition: SystemIdentifier.h:48
KUINT8 m_ui8SystemMode
Definition: SystemIdentifier.h:56
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
SystemMode
Definition: EnumSystemIdentifier.h:105
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8ChangeOptions
Definition: SystemIdentifier.h:68
KUINT16 m_ui16SystemName
Definition: SystemIdentifier.h:54