chore: KDIS datatypes
[KDIS.git] / KDIS / DataTypes / AggregateType.h
blob179e7e545843b865c4e59b78f23cc0aef81f21db
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
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.
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.
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
31 class: AggregateType
32 created: 2009/02/07
33 author: Karl Jones
35 purpose: Holds DIS enum for Aggregate Type
36 size: 64 bits / 8 Octets
37 *********************************************************************/
39 #pragma once
41 #include "./DataTypeBase.h"
43 namespace KDIS {
44 namespace DATA_TYPE {
46 class KDIS_EXPORT AggregateType : public DataTypeBase
48 protected:
50 KUINT8 m_ui8Kind;
52 KUINT8 m_ui8Domain;
54 KUINT16 m_ui16Country;
56 KUINT8 m_ui8Category;
58 KUINT8 m_ui8SubCategory;
60 KUINT8 m_ui8Specific;
62 KUINT8 m_ui8Extra;
64 public:
66 static const KUINT16 AGGREGATE_TYPE_SIZE = 8;
68 AggregateType();
70 AggregateType( KDIS::DATA_TYPE::ENUMS::AggregateKind Kind, KUINT8 Domain, KDIS::DATA_TYPE::ENUMS::Country Country,
71 KUINT8 Categoy, KUINT8 SubCategory, KUINT8 Specific, KUINT8 Extra );
73 AggregateType( KUINT8 Kind, KUINT8 Domain, KUINT8 Country, KUINT8 Categoy,
74 KUINT8 SubCategory, KUINT8 Specific, KUINT8 Extra );
76 AggregateType( KDataStream & stream ) ;
78 virtual ~AggregateType();
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;
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;
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;
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;
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;
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;
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;
143 //************************************
144 // FullName: KDIS::DATA_TYPE::AggregateType::GetAsString
145 // Description: Returns a string representation
146 //************************************
147 virtual KString GetAsString() const;
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 ) ;
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;
164 KBOOL operator == ( const AggregateType & Value ) const;
165 KBOOL operator != ( const AggregateType & Value ) const;
166 KBOOL operator < ( const AggregateType & Value ) const;
169 } // END namespace DATA_TYPES
170 } // END namespace KDIS