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: Minefield_Header
32 DIS: (6) 1278.1a - 1998
36 purpose: Contains common attributes for all minefield PDU.
38 size: 144 bits / 18 octets
39 *********************************************************************/
43 #include "KDIS/DataTypes/EntityIdentifier.hpp"
44 #include "KDIS/PDU/Header.hpp"
49 class KDIS_EXPORT Minefield_Header
: public Header
{
51 KDIS::DATA_TYPE::EntityIdentifier m_MinefieldID
;
54 static const KUINT16 MINEFIELD_HEADER_SIZE
= 18;
58 explicit Minefield_Header(const Header
& H
);
60 Minefield_Header(KDataStream
& stream
);
62 Minefield_Header(const Header
& H
, KDataStream
& stream
);
64 virtual ~Minefield_Header();
66 //************************************
67 // FullName: KDIS::PDU::Minefield_Header::SetMinefieldID
68 // KDIS::PDU::Minefield_Header::GetMinefieldID
69 // Description: The Minefield Identifier (Minefield ID) does not represent an
71 // rather an aggregation of mine entities for the purpose of
72 // conserving bandwidth.
73 // Parameter: const EntityIdentifier & ID
74 //************************************
75 void SetMinefieldID(const KDIS::DATA_TYPE::EntityIdentifier
& ID
);
76 const KDIS::DATA_TYPE::EntityIdentifier
& GetMinefieldID() const;
77 KDIS::DATA_TYPE::EntityIdentifier
& GetMinefieldID();
79 //************************************
80 // FullName: KDIS::PDU::Minefield_Header::GetAsString
81 // Description: Returns a string representation of the PDU
82 //************************************
83 virtual KString
GetAsString() const;
85 //************************************
86 // FullName: KDIS::PDU::Minefield_Header::Decode
87 // Description: Convert From Network Data.
88 // Parameter: KDataStream & stream
89 // Parameter: bool ignoreHeader = false - Decode the header from the stream?
90 //************************************
91 virtual void Decode(KDataStream
& stream
, bool ignoreHeader
= false);
93 //************************************
94 // FullName: KDIS::PDU::Minefield_Header::Encode
95 // Description: Convert To Network Data.
96 // Parameter: KDataStream & stream
97 //************************************
98 virtual KDataStream
Encode() const;
99 virtual void Encode(KDataStream
& stream
) const;
101 KBOOL
operator==(const Minefield_Header
& Value
) const;
102 KBOOL
operator!=(const Minefield_Header
& Value
) const;
105 } // END namespace PDU
106 } // END namespace KDIS