KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LE_EntityIdentifier.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: LE_EntityIdentifier
32  created: 30/06/2010
33  author: Karl Jones
34 
35  purpose: Entity Identifier Field found in Live Entity (LE) PDU's.
36  The site and application id's have been reduced to 8 bits from 16.
37 
38  size: 32 bits / 4 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./DataTypeBase.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
55 
57 
58 public:
59 
60  static const KUINT16 LE_ENTITY_IDENTIFER_SIZE = 4;
61 
63 
64  LE_EntityIdentifier( KUINT8 SiteID, KUINT8 ApplicatonID, KUINT16 EntityID );
65 
66  LE_EntityIdentifier( KDataStream & stream ) throw( KException );
67 
68  virtual ~LE_EntityIdentifier();
69 
70  //************************************
71  // FullName: KDIS::DATA_TYPE::LE_EntityIdentifier::SetSiteID
72  // KDIS::DATA_TYPE::LE_EntityIdentifier::GetSiteID
73  //!Description: Site ID for Live Entity EntityIdentifier's.
74  // Parameter: KUINT8 ID
75  //************************************
76  void SetSiteID( KUINT8 ID );
77  KUINT8 GetSiteID() const;
78 
79  //************************************
80  // FullName: KDIS::DATA_TYPE::LE_EntityIdentifier::SetApplicationID
81  // KDIS::DATA_TYPE::LE_EntityIdentifier::GetApplicationID
82  //!Description: Application ID for Live Entity EntityIdentifier's.
83  // Parameter: KUINT8 ID
84  //************************************
85  void SetApplicationID( KUINT8 ID );
86  KUINT8 GetApplicationID() const;
87 
88  //************************************
89  // FullName: KDIS::DATA_TYPE::LE_EntityIdentifier::SetEntityID
90  // KDIS::DATA_TYPE::LE_EntityIdentifier::GetEntityID
91  //!Description: Entity ID, also known as Object ID, Process Numbers and
92  //! Reference Number in DIS version 7.
93  // Parameter: KUINT16 ID
94  //************************************
95  void SetEntityID( KUINT16 ID );
96  KUINT16 GetEntityID() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::LE_EntityIdentifier::GetAsString
100  //!Description: Returns a string representation
101  //************************************
102  virtual KString GetAsString() const;
103 
104  //************************************
105  // FullName: KDIS::DATA_TYPE::LE_EntityIdentifier::Decode
106  //!Description: Convert From Network Data.
107  // Parameter: KDataStream & stream
108  //************************************
109  virtual void Decode( KDataStream & stream ) throw( KException );
110 
111  //************************************
112  // FullName: KDIS::DATA_TYPE::LE_EntityIdentifier::Encode
113  //!Description: Convert To Network Data.
114  // Parameter: KDataStream & stream
115  //************************************
116  virtual KDataStream Encode() const;
117  virtual void Encode( KDataStream & stream ) const;
118 
119  KBOOL operator == ( const LE_EntityIdentifier & Value ) const;
120  KBOOL operator != ( const LE_EntityIdentifier & Value ) const;
121  KBOOL operator < ( const LE_EntityIdentifier & Value ) const;
122 };
123 
124 } // END namespace DATA_TYPES
125 } // END namespace KDIS
126 
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8SiteID
Definition: LE_EntityIdentifier.h:52
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
KUINT16 m_ui16EntityID
Definition: LE_EntityIdentifier.h:56
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: LE_EntityIdentifier.h:48
KUINT8 m_ui8ApplicationID
Definition: LE_EntityIdentifier.h:54