KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MunitionDescriptor.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: MunitionDescriptor
32  created: 22/04/2013
33  author: Karl Jones
34 
35  purpose: Represents the firing of a a round or a burst of ammunition
36  This data type is also referred to as a Burst Descriptor in older versions of DIS.
37  This descriptor is applicable to the Fire PDU and Detonation PDU.
38  size: 128 bits / 16 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./Descriptor.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
55 
57 
59 
60 public:
61 
63 
64  MunitionDescriptor( KDataStream & stream )throw( KException );
65 
68 
69  virtual ~MunitionDescriptor();
70 
71  //************************************
72  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetWarhead
73  // KDIS::DATA_TYPE::MunitionDescriptor::GetWarhead
74  //!Description: Warhead type enumeration.
75  // Parameter: WarheadType WT
76  //************************************
77  void SetWarhead( KDIS::DATA_TYPE::ENUMS::WarheadType WT );
78  KDIS::DATA_TYPE::ENUMS::WarheadType GetWarhead() const;
79 
80  //************************************
81  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetFuse
82  // KDIS::DATA_TYPE::MunitionDescriptor::GetFuse
83  //!Description: Fuse type enumeration.
84  // Parameter: FuseType FT
85  //************************************
86  void SetFuse( KDIS::DATA_TYPE::ENUMS::FuseType FT );
87  KDIS::DATA_TYPE::ENUMS::FuseType GetFuse() const;
88 
89  //************************************
90  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetQuantity
91  // KDIS::DATA_TYPE::MunitionDescriptor::GetQuantity
92  //!Description: Number of rounds fired in the burst.
93  // Parameter: KUINT16 Q
94  //************************************
95  void SetQuantity( KUINT16 Q );
96  KUINT16 GetQuantity() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::SetRate
100  // KDIS::DATA_TYPE::MunitionDescriptor::GetRate
101  //!Description: Rounds per minute.
102  // Parameter: KUINT16 R
103  //************************************
104  void SetRate( KUINT16 R );
105  KUINT16 GetRate() const;
106 
107  //************************************
108  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::GetAsString
109  //!Description: Returns a string representation.
110  //************************************
111  virtual KString GetAsString() const;
112 
113  //************************************
114  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::Decode
115  //!Description: Convert From Network Data.
116  // Parameter: KDataStream & stream
117  //************************************
118  virtual void Decode( KDataStream & stream ) throw( KException );
119 
120  //************************************
121  // FullName: KDIS::DATA_TYPE::MunitionDescriptor::Encode
122  //!Description: Convert To Network Data.
123  // Parameter: KDataStream & stream
124  //************************************
125  virtual KDataStream Encode() const;
126  virtual void Encode( KDataStream & stream ) const;
127 
128  KBOOL operator == ( const MunitionDescriptor & Value ) const;
129  KBOOL operator != ( const MunitionDescriptor & Value ) const;
130 };
131 
132 } // END namespace DATA_TYPES
133 } // END namespace KDIS
KUINT16 m_ui16Quantity
Definition: MunitionDescriptor.h:56
Definition: EntityType.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
FuseType
Definition: EnumBurstDescriptor.h:137
Definition: KDefines.h:182
Definition: Descriptor.h:70
Definition: KDataStream.h:48
KUINT16 m_ui16Warhead
Definition: MunitionDescriptor.h:52
bool KBOOL
Definition: KDefines.h:119
Definition: MunitionDescriptor.h:48
std::string KString
Definition: KDefines.h:116
KUINT16 m_ui16Fuse
Definition: MunitionDescriptor.h:54
WarheadType
Definition: EnumBurstDescriptor.h:53
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT16 m_ui16Rate
Definition: MunitionDescriptor.h:58