KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SimulationIdentifier.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: SimulationIdentifier
32  created: 2009/11/24
33  author: Karl Jones
34 
35  purpose: Simulation Identifier. Site and Application number.
36  Also known as the Simulation Address record in DIS 7.
37 
38  Note: If you are looking for the DIS 7 Simulation Identifier(the one with the extra 16 bits)
39  then see EntityIdentifier.
40 
41  size: 32 bits / 4 octets
42 *********************************************************************/
43 
44 #pragma once
45 
46 #include "./DataTypeBase.h"
47 
48 namespace KDIS {
49 namespace DATA_TYPE {
50 
52 {
53 protected:
54 
56 
58 
59 public:
60 
61  static const KUINT16 SIMULATION_IDENTIFIER_SIZE = 4;
62 
64 
65  SimulationIdentifier( KUINT16 SiteID, KUINT16 ApplicatonID );
66 
67  SimulationIdentifier( KDataStream & stream ) throw( KException );
68 
69  virtual ~SimulationIdentifier();
70 
71  //************************************
72  // FullName: KDIS::DATA_TYPE::SimulationIdentifier::SetSiteID
73  // KDIS::DATA_TYPE::SimulationIdentifier::GetSiteID
74  //!Description: Site ID.
75  //! A site is defined as a facility, installation, organizational unit or a geographic
76  //! location that has one or more simulation applications capable of participating in a
77  //! distributed event. A facility, installation, organizational unit or geographic location
78  //! may have multiple sites associated with it.
79  //! Each site participating in an event (e.g., training exercise, experiment, test) shall be
80  //! assigned a unique Site Number that is different from any other site that is part of the same event.
81  //! A simulation site is a site that generates simulated objects based on simulated data. A live site
82  //! is a site that is associated with producing live objects from live sources such as producing
83  //! entities representing live aircraft flying in a live training range. A simulation associated
84  //! with a live site may issue Live Entity PDUs (e.g., the TSPI PDU) for the live objects or may
85  //! issue Entity State PDUs for them.
86  // Parameter: KUINT16 ID
87  //************************************
88  void SetSiteID( KUINT16 ID );
89  KUINT16 GetSiteID() const;
90 
91  //************************************
92  // FullName: KDIS::DATA_TYPE::SimulationIdentifier::SetApplicationID
93  // KDIS::DATA_TYPE::SimulationIdentifier::GetApplicationID
94  //!Description: Application ID.
95  //! An application is defined as a software program that is used to generate and process
96  //! distributed simulation data including live, virtual and constructive data.
97  //! Each application participating in an event (e.g., training exercise) shall be
98  //! assigned a unique Application Number for the site with which the application is associated.
99  // Parameter: KUINT16 ID
100  //************************************
101  void SetApplicationID( KUINT16 ID );
102  KUINT16 GetApplicationID() const;
103 
104  //************************************
105  // FullName: KDIS::DATA_TYPE::SimulationIdentifier::GetAsString
106  //!Description: Returns a string representation.
107  //************************************
108  virtual KString GetAsString() const;
109 
110  //************************************
111  // FullName: KDIS::DATA_TYPE::SimulationIdentifier::Decode
112  //!Description: Convert From Network Data.
113  // Parameter: KDataStream & stream
114  //************************************
115  virtual void Decode( KDataStream & stream ) throw( KException );
116 
117  //************************************
118  // FullName: KDIS::DATA_TYPE::SimulationIdentifier::Encode
119  //!Description: Convert To Network Data.
120  // Parameter: KDataStream & stream
121  //************************************
122  virtual KDataStream Encode() const;
123  virtual void Encode( KDataStream & stream ) const;
124 
125  KBOOL operator == ( const SimulationIdentifier & Value ) const;
126  KBOOL operator != ( const SimulationIdentifier & Value ) const;
127  KBOOL operator < ( const SimulationIdentifier & Value ) const;
128 };
129 
130 } // END namespace DATA_TYPES
131 } // END namespace KDIS
132 
Definition: SimulationIdentifier.h:51
KUINT16 m_ui16SiteID
Definition: SimulationIdentifier.h:55
unsigned short int KUINT16
Definition: KDefines.h:101
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_ui16ApplicationID
Definition: SimulationIdentifier.h:57
#define KDIS_EXPORT
Definition: KDefines.h:82