KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AggregateType.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: AggregateType
32  created: 2009/02/07
33  author: Karl Jones
34 
35  purpose: Holds DIS enum for Aggregate 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 
51 
53 
55 
57 
59 
61 
63 
64 public:
65 
66  static const KUINT16 AGGREGATE_TYPE_SIZE = 8;
67 
68  AggregateType();
69 
71  KUINT8 Categoy, KUINT8 SubCategory, KUINT8 Specific, KUINT8 Extra );
72 
73  AggregateType( KUINT8 Kind, KUINT8 Domain, KUINT8 Country, KUINT8 Categoy,
74  KUINT8 SubCategory, KUINT8 Specific, KUINT8 Extra );
75 
76  AggregateType( KDataStream & stream ) throw( KException );
77 
78  virtual ~AggregateType();
79 
80  //************************************
81  // FullName: KDIS::DATA_TYPE::AggregateType::SetEntityKind
82  // KDIS::DATA_TYPE::AggregateType::GetEntityKind
83  //!Description: Kind
84  // Parameter: AggregateKind UI, void
85  //************************************
86  void SetEntityKind( KDIS::DATA_TYPE::ENUMS::AggregateKind AK );
87  KDIS::DATA_TYPE::ENUMS::AggregateKind GetEntityKind() const;
88 
89  //************************************
90  // FullName: KDIS::DATA_TYPE::AggregateType::SetDomain
91  // KDIS::DATA_TYPE::AggregateType::GetDomain
92  //!Description: Domain - Same as Entity Type record
93  // Parameter: EntityDomain UI, void
94  //************************************
95  void SetDomain( KDIS::DATA_TYPE::ENUMS::EntityDomain UI );
96  KDIS::DATA_TYPE::ENUMS::EntityDomain GetDomain() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::AggregateType::SetCountry
100  // KDIS::DATA_TYPE::AggregateType::GetCountry
101  //!Description: Country
102  // Parameter: Country UI, void
103  //************************************
104  void SetCountry( KDIS::DATA_TYPE::ENUMS::Country UI );
105  KDIS::DATA_TYPE::ENUMS::Country GetCountry() const;
106 
107  //************************************
108  // FullName: KDIS::DATA_TYPE::AggregateType::SetCategory
109  // KDIS::DATA_TYPE::AggregateType::GetCategory
110  //!Description: Category
111  // Parameter: KUINT8 UI, void
112  //************************************
113  void SetCategory( KUINT8 UI );
114  KUINT8 GetCategory() const;
115 
116  //************************************
117  // FullName: KDIS::DATA_TYPE::AggregateType::SetSubCategory
118  // KDIS::DATA_TYPE::AggregateType::GetSubCategory
119  //!Description: Sub Category
120  // Parameter: KUINT8 UI, void
121  //************************************
122  void SetSubCategory( KUINT8 UI );
123  KUINT8 GetSubCategory() const;
124 
125  //************************************
126  // FullName: KDIS::DATA_TYPE::AggregateType::SetSpecific
127  // KDIS::DATA_TYPE::AggregateType::GetSpecific
128  //!Description: Specific
129  // Parameter: KUINT8 UI, void
130  //************************************
131  void SetSpecific( KUINT8 UI );
132  KUINT8 GetSpecific() const;
133 
134  //************************************
135  // FullName: KDIS::DATA_TYPE::AggregateType::SetExtra
136  // KDIS::DATA_TYPE::AggregateType::GetExtra
137  //!Description: Extra
138  // Parameter: KUINT8 UI, void
139  //************************************
140  void SetExtra( KUINT8 UI );
141  KUINT8 GetExtra() const;
142 
143  //************************************
144  // FullName: KDIS::DATA_TYPE::AggregateType::GetAsString
145  //!Description: Returns a string representation
146  //************************************
147  virtual KString GetAsString() const;
148 
149  //************************************
150  // FullName: KDIS::DATA_TYPE::AggregateType::Decode
151  //!Description: Convert From Network Data.
152  // Parameter: KDataStream & stream
153  //************************************
154  virtual void Decode( KDataStream & stream ) throw( KException );
155 
156  //************************************
157  // FullName: KDIS::DATA_TYPE::AggregateType::Encode
158  //!Description: Convert To Network Data.
159  // Parameter: KDataStream & stream
160  //************************************
161  virtual KDataStream Encode() const;
162  virtual void Encode( KDataStream & stream ) const;
163 
164  KBOOL operator == ( const AggregateType & Value ) const;
165  KBOOL operator != ( const AggregateType & Value ) const;
166  KBOOL operator < ( const AggregateType & Value ) const;
167 };
168 
169 } // END namespace DATA_TYPES
170 } // END namespace KDIS
171 
KUINT8 m_ui8Category
Definition: AggregateType.h:56
KUINT8 m_ui8Extra
Definition: AggregateType.h:62
Country
Definition: EnumEntityInfoInteraction.h:105
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8Kind
Definition: AggregateType.h:50
KUINT8 m_ui8Domain
Definition: AggregateType.h:52
AggregateKind
Definition: EnumEntityManagement.h:74
Definition: KDefines.h:182
Definition: KDataStream.h:48
KUINT8 m_ui8SubCategory
Definition: AggregateType.h:58
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
EntityDomain
Definition: EnumEntityInfoInteraction.h:90
KUINT8 m_ui8Specific
Definition: AggregateType.h:60
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT16 m_ui16Country
Definition: AggregateType.h:54
Definition: AggregateType.h:46