KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
EnvironmentType.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: EnvironmentType
32  created: 27/06/2009
33  author: Karl Jones
34 
35  purpose: Holds DIS enum for Environment Type.
36  size: 64 bits / 8 Octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./DataTypeBase.h"
42 
43 namespace KDIS {
44 namespace DATA_TYPE {
45 
47 {
48 protected:
49 
50  KUINT8 m_ui8EntityKind; // This value should allways be Environmental(4)
51 
53 
55 
57 
59 
61 
63 
64 public:
65 
66  static const KUINT16 ENVIROMENT_TYPE_SIZE = 8;
67 
69 
71  KDIS::DATA_TYPE::ENUMS::EnvironmentSubcategory SubCategory, KUINT8 Specific, KUINT8 Extra );
72 
74  KDIS::DATA_TYPE::ENUMS::EnvironmentSubcategory SubCategory, KUINT8 Specific, KUINT8 Extra );
75 
76  EnvironmentType( KDataStream & stream ) throw( KException );
77 
78  virtual ~EnvironmentType();
79 
80  //************************************
81  // FullName: KDIS::DATA_TYPE::AggregateType::SetKind
82  // KDIS::DATA_TYPE::AggregateType::GetKind
83  //!Description: Kind. This values should be 4 according to the EBV document however
84  //! some DIS application do use other values for custom types.
85  // Parameter: KUINT8 UI, void
86  //************************************
87  void SetKind( KUINT8 K );
88  KUINT8 GetKind() const;
89 
90  //************************************
91  // FullName: KDIS::DATA_TYPE::EnvironmentType::SetDomain
92  // KDIS::DATA_TYPE::EnvironmentType::GetDomain
93  //!Description: Domain
94  // Parameter: EntityDomain UI, void
95  //************************************
96  void SetDomain( KDIS::DATA_TYPE::ENUMS::EntityDomain UI );
97  KDIS::DATA_TYPE::ENUMS::EntityDomain GetDomain() const;
98 
99  //************************************
100  // FullName: KDIS::DATA_TYPE::EnvironmentType::SetClass
101  // KDIS::DATA_TYPE::EnvironmentType::GetClass
102  //!Description: Class
103  // Parameter: KUINT16 CL, void
104  //************************************
105  void SetClass( KUINT16 UI );
106  KUINT16 GetClass() const;
107 
108  //************************************
109  // FullName: KDIS::DATA_TYPE::EnvironmentType::SetCategory
110  // KDIS::DATA_TYPE::EnvironmentType::GetCategory
111  //!Description: Category
112  // Parameter: KUINT8 UI, void
113  //************************************
114  void SetCategory( KUINT8 UI );
115  KUINT8 GetCategory() const;
116 
117  //************************************
118  // FullName: KDIS::DATA_TYPE::EnvironmentType::SetSubCategory
119  // KDIS::DATA_TYPE::EnvironmentType::GetSubCategory
120  //!Description: Sub Category
121  // Parameter: EnvironmentSubcategory UI, void
122  //************************************
123  void SetSubCategory( KDIS::DATA_TYPE::ENUMS::EnvironmentSubcategory UI );
124  KDIS::DATA_TYPE::ENUMS::EnvironmentSubcategory GetSubCategory() const;
125 
126  //************************************
127  // FullName: KDIS::DATA_TYPE::EnvironmentType::SetSpecific
128  // KDIS::DATA_TYPE::EnvironmentType::GetSpecific
129  //!Description: Specific
130  // Parameter: KUINT8 UI, void
131  //************************************
132  void SetSpecific( KUINT8 UI );
133  KUINT8 GetSpecific() const;
134 
135  //************************************
136  // FullName: KDIS::DATA_TYPE::EnvironmentType::SetExtra
137  // KDIS::DATA_TYPE::EnvironmentType::GetExtra
138  //!Description: Extra
139  // Parameter: KUINT8 UI, void
140  //************************************
141  void SetExtra( KUINT8 UI );
142  KUINT8 GetExtra() const;
143 
144  //************************************
145  // FullName: KDIS::DATA_TYPE::EnvironmentType::GetAsString
146  //!Description: Returns a string representation
147  //************************************
148  virtual KString GetAsString() const;
149 
150  //************************************
151  // FullName: KDIS::DATA_TYPE::EnvironmentType::Decode
152  //!Description: Convert From Network Data.
153  // Parameter: KDataStream & stream
154  //************************************
155  virtual void Decode( KDataStream & stream ) throw( KException );
156 
157  //************************************
158  // FullName: KDIS::DATA_TYPE::EnvironmentType::Encode
159  //!Description: Convert To Network Data.
160  // Parameter: KDataStream & stream
161  //************************************
162  virtual KDataStream Encode() const;
163  virtual void Encode( KDataStream & stream ) const;
164 
165  KBOOL operator == ( const EnvironmentType & Value ) const;
166  KBOOL operator != ( const EnvironmentType & Value ) const;
167  KBOOL operator < ( const EnvironmentType & Value ) const;
168 };
169 
170 } // END namespace DATA_TYPES
171 } // END namespace KDIS
172 
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8Category
Definition: EnvironmentType.h:56
Definition: EnvironmentType.h:46
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
KUINT8 m_ui8Domain
Definition: EnvironmentType.h:52
EnvironmentSubcategory
Definition: EnumSyntheticEnviroment.h:90
bool KBOOL
Definition: KDefines.h:119
KUINT8 m_ui8EntityKind
Definition: EnvironmentType.h:50
std::string KString
Definition: KDefines.h:116
EntityDomain
Definition: EnumEntityInfoInteraction.h:90
KUINT16 m_ui16Class
Definition: EnvironmentType.h:54
KUINT8 m_ui8SubCategory
Definition: EnvironmentType.h:58
KUINT8 m_ui8Extra
Definition: EnvironmentType.h:62
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8Specific
Definition: EnvironmentType.h:60