KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FlareState.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: FlareState
32  created: 07/09/2009
33  author: Karl Jones
34 
35  purpose: Represents a flare state, part of an environment record.
36  size: 256 bits / 32 octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./EnvironmentRecord.h"
42 #include "./EntityType.h"
43 #include "./EulerAngles.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
55 
57 
59 
61 
63 
64 public:
65 
66  static const KUINT16 FLARE_STATE_SIZE = 32;
67 
68  FlareState();
69 
70  FlareState( KDataStream & stream ) throw( KException );
71 
72  FlareState( KUINT8 Index, KUINT32 TimeSinceCreation, const EntityType & MunitionSource,
73  KUINT32 NumberIntensity, KUINT32 NumberOfSources, KUINT16 GeometryIndex );
74 
75  virtual ~FlareState();
76 
77  //************************************
78  // FullName: KDIS::DATA_TYPE::FlareState::SetTimeSinceCreation
79  // KDIS::DATA_TYPE::FlareState::GetLGetTimeSinceCreationocation
80  //!Description: The time elapsed since the flare object was created.
81  // Parameter: KUINT32 TSC
82  //************************************
83  void SetTimeSinceCreation( KUINT32 TSC );
84  KUINT32 GetTimeSinceCreation() const;
85 
86  //************************************
87  // FullName: KDIS::DATA_TYPE::FlareState::SetSource
88  // KDIS::DATA_TYPE::FlareState::GetSource
89  //!Description: The source of the flare.
90  // Parameter: const EntityType & S
91  //************************************
92  void SetSource( const EntityType & S );
93  const EntityType GetSource() const;
94  EntityType GetSource();
95 
96  //************************************
97  // FullName: KDIS::DATA_TYPE::FlareState::SetNumberIntensity
98  // KDIS::DATA_TYPE::FlareState::GetNumberIntensity
99  //!Description: Number Intensity of the flare.
100  // Parameter: KUINT32 NI, void
101  //************************************
102  void SetNumberIntensity( KUINT32 NI );
103  KUINT32 GetNumberIntensity() const;
104 
105  //************************************
106  // FullName: KDIS::DATA_TYPE::FlareState::SetNumberOfSources
107  // KDIS::DATA_TYPE::FlareState::GetNumberOfSources
108  //!Description: The number of sources that have created the flare object.
109  // Parameter: KUINT32 NOS
110  //************************************
111  void SetNumberOfSources( KUINT32 NOS );
112  KUINT32 GetNumberOfSources() const;
113 
114  //************************************
115  // FullName: KDIS::DATA_TYPE::FlareState::SetGeometryIndex
116  // KDIS::DATA_TYPE::FlareState::GetGeometryIndex
117  //!Description: The geometry index.
118  // Parameter: KUINT16 GI
119  //************************************
120  void SetGeometryIndex( KUINT16 GI );
121  KUINT16 GetGeometryIndex() const;
122 
123  //************************************
124  // FullName: KDIS::DATA_TYPE::FlareState::GetAsString
125  //!Description: Returns a string representation
126  //************************************
127  virtual KString GetAsString() const;
128 
129  //************************************
130  // FullName: KDIS::DATA_TYPE::FlareState::Decode
131  //!Description: Convert From Network Data.
132  // Parameter: KDataStream & stream
133  //************************************
134  virtual void Decode( KDataStream & stream ) throw( KException );
135 
136  //************************************
137  // FullName: KDIS::DATA_TYPE::FlareState::Encode
138  //!Description: Convert To Network Data.
139  // Parameter: KDataStream & stream
140  //************************************
141  virtual KDataStream Encode() const;
142  virtual void Encode( KDataStream & stream ) const;
143 
144  KBOOL operator == ( const FlareState & Value )const;
145  KBOOL operator != ( const FlareState & Value )const;
146 };
147 
148 } // END namespace DATA_TYPES
149 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
Definition: EntityType.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT16 m_ui16Padding
Definition: FlareState.h:62
KUINT32 m_ui32NumInt
Definition: FlareState.h:56
EntityType m_Src
Definition: FlareState.h:54
KUINT16 m_ui16GeometryIndex
Definition: FlareState.h:60
Definition: KDefines.h:182
Definition: KDataStream.h:48
KUINT32 m_ui32TSC
Definition: FlareState.h:52
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
KUINT32 m_ui32NumSrcs
Definition: FlareState.h:58
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: FlareState.h:48
Definition: EnvironmentRecord.h:59