KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Mode5InterrogatorBasicData.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: Mode5InterrogatorBasicData
32  DIS: (7) 1278.1 - 2012
33  created: 30/09/2013
34  author: Karl Jones
35 
36  purpose: Included in the Mode 5 Interrogator format for Layer 3 of the IFF PDU.
37 
38  Size: 128 bits / 16 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./DataTypeBase.h"
44 #include "./EntityIdentifier.h"
46 #include <bitset>
47 
48 namespace KDIS {
49 namespace DATA_TYPE {
50 
52 {
53 protected:
54 
56 
58 
60 
62 
64 
66 
67 public:
68 
69  static const KUINT16 MODE_5_INTERROGATOR_BASIC_DATA_SIZE = 16;
70 
72 
73  Mode5InterrogatorBasicData( const Mode5InterrogatorStatus & Status, KUINT32 FormatsPresent, const EntityIdentifier & ID );
74 
76 
77  virtual ~Mode5InterrogatorBasicData();
78 
79  //************************************
80  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::SetStatus
81  // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetStatus
82  //!Description: The Mode 5 Message Formats supported by this Mode 5 interrogator.
83  // Parameter: const InterrogatorStatus & S
84  //************************************
85  void SetStatus( const Mode5InterrogatorStatus & S );
86  const Mode5InterrogatorStatus & GetStatus() const;
87  Mode5InterrogatorStatus & GetStatus();
88 
89  //************************************
90  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::SetMessageFormatsPresent
91  // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetMessageFormatsPresentBitSet
92  // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetMessageFormatsPresent
93  //!Description: The Mode 5 Message Formats supported by this Mode 5 interrogator.
94  //! When a Mode 5 interrogator is in the Regeneration Mode, the included message
95  //! formats shall be either:
96  //! 1) Those that this Mode 5 interrogator is capableof supporting and could be sent
97  //! in a Mode 5 interrogation as indicated by the Message Formats Status field being
98  //! set to Capability (0).
99  //! 2) Only the specific message formats associated with this Mode 5 interrogator�s
100  //! current active interrogation as indicated by the Message Formats Status field
101  //! being set to Active Interrogation (1).
102  //! When a Mode 5 interrogator is in the Interactive Mode, the requirements specified in
103  //! Interactive Basic Mode 5 IFF Data record are applicable.
104  //! Each bit represents a specific message format: Not Present (0) and Present (1).
105  // Parameter: KUINT32 MFP, const std::bitset<32> & MFP
106  //************************************
107  void SetMessageFormatsPresent( KUINT32 MFP );
108  void SetMessageFormatsPresent( const std::bitset<32> & MFP );
109  const std::bitset<32> GetMessageFormatsPresentBitSet() const;
110  KUINT32 GetMessageFormatsPresent();
111 
112  //************************************
113  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::SetInterrogatedEntityID
114  // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetInterrogatedEntityID
115  //!Description: The Entity ID of the entity to which an active interrogation is being
116  //! directed. If there is no active interrogation, this field shall be set
117  //! to NO_SPECIFIC_ENTITY.
118  // Parameter: const EntityIdentifier & ID
119  //************************************
120  void SetInterrogatedEntityID( const EntityIdentifier & ID );
121  const EntityIdentifier & GetInterrogatedEntityID() const;
122  EntityIdentifier & GetInterrogatedEntityID();
123 
124  //************************************
125  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetAsString
126  //!Description: Returns a string representation
127  //! of the PDU.
128  //************************************
129  virtual KString GetAsString() const;
130 
131  //************************************
132  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::Decode
133  //!Description: Convert From Network Data.
134  // Parameter: KDataStream & stream
135  //************************************
136  virtual void Decode( KDataStream & stream ) throw( KException );
137 
138  //************************************
139  // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::Encode
140  //!Description: Convert To Network Data.
141  // Parameter: KDataStream & stream
142  //************************************
143  virtual KDataStream Encode() const;
144  virtual void Encode( KDataStream & stream ) const;
145 
146  KBOOL operator == ( const Mode5InterrogatorBasicData & Value ) const;
147  KBOOL operator != ( const Mode5InterrogatorBasicData & Value ) const;
148 };
149 
150 } // END namespace DATA_TYPE
151 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
KUINT16 m_ui16Padding2
Definition: Mode5InterrogatorBasicData.h:65
EntityIdentifier m_InterrogatedID
Definition: Mode5InterrogatorBasicData.h:63
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
Definition: Mode5InterrogatorStatus.h:50
Mode5InterrogatorStatus m_Status
Definition: Mode5InterrogatorBasicData.h:55
KUINT8 m_ui8Padding
Definition: Mode5InterrogatorBasicData.h:57
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
unsigned char KUINT8
Definition: KDefines.h:99
KUINT16 m_ui16Padding1
Definition: Mode5InterrogatorBasicData.h:59
KUINT32 m_ui32MsgFormats
Definition: Mode5InterrogatorBasicData.h:61
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: Mode5InterrogatorBasicData.h:51