1 /*********************************************************************
2 Copyright 2013 Karl Jones
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
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.
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.
25 For Further Information Please Contact me at
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
31 class: Mode5InterrogatorBasicData
32 DIS: (7) 1278.1 - 2012
36 purpose: Included in the Mode 5 Interrogator format for Layer 3 of the
39 Size: 128 bits / 16 octets
40 *********************************************************************/
46 #include "KDIS/DataTypes/DataTypeBase.hpp"
47 #include "KDIS/DataTypes/EntityIdentifier.hpp"
48 #include "KDIS/DataTypes/Mode5InterrogatorStatus.hpp"
53 class KDIS_EXPORT Mode5InterrogatorBasicData
: public DataTypeBase
{
55 Mode5InterrogatorStatus m_Status
;
59 KUINT16 m_ui16Padding1
;
61 KUINT32 m_ui32MsgFormats
;
63 EntityIdentifier m_InterrogatedID
;
65 KUINT16 m_ui16Padding2
;
68 static const KUINT16 MODE_5_INTERROGATOR_BASIC_DATA_SIZE
= 16;
70 Mode5InterrogatorBasicData();
72 Mode5InterrogatorBasicData(const Mode5InterrogatorStatus
& Status
,
73 KUINT32 FormatsPresent
,
74 const EntityIdentifier
& ID
);
76 Mode5InterrogatorBasicData(KDataStream
& stream
);
78 virtual ~Mode5InterrogatorBasicData();
80 //************************************
81 // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::SetStatus
82 // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetStatus
83 // Description: The Mode 5 Message Formats supported by this Mode 5
84 // interrogator. Parameter: const InterrogatorStatus & S
85 //************************************
86 void SetStatus(const Mode5InterrogatorStatus
& S
);
87 const Mode5InterrogatorStatus
& GetStatus() const;
88 Mode5InterrogatorStatus
& GetStatus();
90 //************************************
92 // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::SetMessageFormatsPresent
93 // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetMessageFormatsPresentBitSet
94 // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetMessageFormatsPresent
95 // Description: The Mode 5 Message Formats supported by this Mode 5
97 // When a Mode 5 interrogator is in the Regeneration Mode, the
98 // included message formats shall be either: 1) Those that this
99 // Mode 5 interrogator is capableof supporting and could be sent
100 // in a Mode 5 interrogation as indicated by the Message Formats
101 // Status field being set to Capability (0). 2) Only the specific
102 // message formats associated with this Mode 5 interrogator's
103 // current active interrogation as indicated by the Message
104 // Formats Status field being set to Active Interrogation (1).
105 // When a Mode 5 interrogator is in the Interactive Mode, the
106 // requirements specified in Interactive Basic Mode 5 IFF Data
107 // record are applicable. Each bit represents a specific message
108 // format: Not Present (0) and Present (1).
109 // Parameter: KUINT32 MFP, const std::bitset<32> & MFP
110 //************************************
111 void SetMessageFormatsPresent(KUINT32 MFP
);
112 void SetMessageFormatsPresent(const std::bitset
<32>& MFP
);
113 const std::bitset
<32> GetMessageFormatsPresentBitSet() const;
114 KUINT32
GetMessageFormatsPresent() const;
116 //************************************
118 // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::SetInterrogatedEntityID
119 // KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetInterrogatedEntityID
120 // Description: The Entity ID of the entity to which an active interrogation
122 // directed. If there is no active interrogation, this field
123 // shall be set to NO_SPECIFIC_ENTITY.
124 // Parameter: const EntityIdentifier & ID
125 //************************************
126 void SetInterrogatedEntityID(const EntityIdentifier
& ID
);
127 const EntityIdentifier
& GetInterrogatedEntityID() const;
128 EntityIdentifier
& GetInterrogatedEntityID();
130 //************************************
131 // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::GetAsString
132 // Description: Returns a string representation
134 //************************************
135 virtual KString
GetAsString() const;
137 //************************************
138 // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::Decode
139 // Description: Convert From Network Data.
140 // Parameter: KDataStream & stream
141 //************************************
142 virtual void Decode(KDataStream
& stream
);
144 //************************************
145 // FullName: KDIS::DATA_TYPE::Mode5InterrogatorBasicData::Encode
146 // Description: Convert To Network Data.
147 // Parameter: KDataStream & stream
148 //************************************
149 virtual KDataStream
Encode() const;
150 virtual void Encode(KDataStream
& stream
) const;
152 KBOOL
operator==(const Mode5InterrogatorBasicData
& Value
) const;
153 KBOOL
operator!=(const Mode5InterrogatorBasicData
& Value
) const;
156 } // END namespace DATA_TYPE
157 } // END namespace KDIS