KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ObjectType.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: ObjectType
32  created: 24/01/2010
33  author: Karl Jones
34 
35  purpose: Represents the type of the synthetic environment
36  object(point, linear and areal).
37  size: 32 bits / 4 Octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./DataTypeBase.h"
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
52 
54 
56 
58 
59 public:
60 
61  static const KUINT16 OBJECT_TYPE_SIZE = 4;
62 
63  ObjectType();
64 
65  ObjectType( KUINT8 Domain, KUINT8 Kind, KUINT8 Categoy, KUINT8 SubCategory );
66 
67  ObjectType( KDataStream & stream ) throw( KException );
68 
69  virtual ~ObjectType();
70 
71  //************************************
72  // FullName: KDIS::DATA_TYPE::ObjectType::SetDomain
73  // KDIS::DATA_TYPE::ObjectType::GetDomain
74  //!Description: Objects domain.
75  // Parameter: EntityDomain UI
76  //************************************
77  void SetDomain( KDIS::DATA_TYPE::ENUMS::EntityDomain UI );
78  KDIS::DATA_TYPE::ENUMS::EntityDomain GetDomain() const;
79 
80  //************************************
81  // FullName: KDIS::DATA_TYPE::ObjectType::SetEntityKind
82  // KDIS::DATA_TYPE::ObjectType::GetEntityKind
83  //!Description: Object Kind.
84  // Parameter: KUINT8 UI
85  //************************************
86  void SetEntityKind( KUINT8 UI );
87  KUINT8 GetEntityKind() const;
88 
89  //************************************
90  // FullName: KDIS::DATA_TYPE::ObjectType::SetCategory
91  // KDIS::DATA_TYPE::ObjectType::GetCategory
92  //!Description: Category.
93  // Parameter: KUINT8 UI
94  //************************************
95  void SetCategory( KUINT8 UI );
96  KUINT8 GetCategory() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::ObjectType::SetSubCategory
100  // KDIS::DATA_TYPE::ObjectType::GetSubCategory
101  //!Description: Sub Category.
102  // Parameter: KUINT8 UI
103  //************************************
104  void SetSubCategory( KUINT8 UI );
105  KUINT8 GetSubCategory() const;
106 
107  //************************************
108  // FullName: KDIS::DATA_TYPE::ObjectType::GetAsString
109  //!Description: Returns a string representation.
110  //************************************
111  virtual KString GetAsString() const;
112 
113  //************************************
114  // FullName: KDIS::DATA_TYPE::ObjectType::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::ObjectType::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 ObjectType & Value ) const;
129  KBOOL operator != ( const ObjectType & Value ) const;
130  KBOOL operator < ( const ObjectType & Value ) const;
131 };
132 
133 } // END namespace DATA_TYPES
134 } // END namespace KDIS
135 
KUINT8 m_ui8Domain
Definition: ObjectType.h:51
Definition: ObjectType.h:47
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8SubCategory
Definition: ObjectType.h:57
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
EntityDomain
Definition: EnumEntityInfoInteraction.h:90
KUINT8 m_ui8EntityKind
Definition: ObjectType.h:53
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8Category
Definition: ObjectType.h:55