1 /*********************************************************************
3 Copyright 2013 Karl Jones
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice, this
10 list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 For Further Information Please Contact me at
28 http://p.sf.net/kdis/UserGuide
29 *********************************************************************/
31 /********************************************************************
36 purpose: Represent the primary, secondary fuse and anti-handling
38 size: 16 bits / 2 octets
39 *********************************************************************/
43 #include "./DataTypeBase.h"
48 class KDIS_EXPORT MineFusing
: public DataTypeBase
56 KUINT16 m_ui16Primary
: 7;
57 KUINT16 m_ui16Secondary
: 7;
58 KUINT16 m_ui16AHD
: 1;
59 KUINT16 m_ui16Unused
: 1;
67 static const KUINT16 MINE_FUSING_SIZE
= 2;
71 MineFusing( KDIS::DATA_TYPE::ENUMS::MineFuse Primary
, KDIS::DATA_TYPE::ENUMS::MineFuse Secondary
, KBOOL AntiHandlingDevice
);
73 MineFusing( KDataStream
& stream
) ;
75 virtual ~MineFusing();
77 //************************************
78 // FullName: KDIS::DATA_TYPE::MineFusing::SetPrimaryFuse
79 // KDIS::DATA_TYPE::MineFusing::GetPrimaryFuse
80 // Description: Identifies the type of the primary fuse.
81 // Parameter: MineFuse F
82 //************************************
83 void SetPrimaryFuse( KDIS::DATA_TYPE::ENUMS::MineFuse F
);
84 KDIS::DATA_TYPE::ENUMS::MineFuse
GetPrimaryFuse() const;
86 //************************************
87 // FullName: KDIS::DATA_TYPE::MineFusing::SetSecondaryFuse
88 // KDIS::DATA_TYPE::MineFusing::GetSecondaryFuse
89 // Description: Identifies the type of the secondary fuse.
90 // Parameter: MineFuse F
91 //************************************
92 void SetSecondaryFuse( KDIS::DATA_TYPE::ENUMS::MineFuse F
);
93 KDIS::DATA_TYPE::ENUMS::MineFuse
GetSecondaryFuse() const;
95 //************************************
96 // FullName: KDIS::DATA_TYPE::MineFusing::SetHasAntiHandlingDevice
97 // KDIS::DATA_TYPE::MineFusing::GetHasAntiHandlingDevice
98 // Description: Describes the anti-handling device status of the mine
99 // true = anti-handling device.
100 // false = No anti-handling device.
101 // Parameter: KBOOL AHD
102 //************************************
103 void SetHasAntiHandlingDevice( KBOOL AHD
);
104 KBOOL
GetHasAntiHandlingDevice() const;
106 //************************************
107 // FullName: KDIS::DATA_TYPE::MineFusing::GetAsString
108 // Description: Returns a string representation
109 //************************************
110 virtual KString
GetAsString() const;
112 //************************************
113 // FullName: KDIS::DATA_TYPE::MineFusing::Decode
114 // Description: Convert From Network Data.
115 // Parameter: KDataStream & stream
116 //************************************
117 virtual void Decode( KDataStream
& stream
) ;
119 //************************************
120 // FullName: KDIS::DATA_TYPE::MineFusing::Encode
121 // Description: Convert To Network Data.
122 // Parameter: KDataStream & stream
123 //************************************
124 virtual KDataStream
Encode() const;
125 virtual void Encode( KDataStream
& stream
) const;
127 KBOOL
operator == ( const MineFusing
& Value
) const;
128 KBOOL
operator != ( const MineFusing
& Value
) const;
131 } // END namespace DATA_TYPES
132 } // END namespace KDIS