KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AttachedPart.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: AttachedPart
32  updated: 08/03/2013
33  author: Karl Jones
34 
35  purpose: Specification of removable parts that may be attached to an entity.
36  E.G A missile attached to an aircraft wing.
37 
38  size: 128 bits / 16 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./VariableParameter.h"
44 #include "./EntityType.h"
45 
46 namespace KDIS {
47 namespace DATA_TYPE {
48 
50 
52 {
53 protected:
54 
56 
58 
60 
62 
63 public:
64 
65  AttachedPart();
66 
67  AttachedPart( KUINT8 DetachedIndicator, KUINT16 PartAttachedToID, AttachedPartParameterType APPT, const EntityType & Type );
68 
69  AttachedPart( KUINT8 DetachedIndicator, KUINT16 PartAttachedToID, KUINT32 APPT, const EntityType & Type );
70 
71  AttachedPart( KDataStream & stream ) throw( KException );
72 
73  virtual ~AttachedPart();
74 
75  //************************************
76  // FullName: KDIS::DATA_TYPE::AttachedPart::SetDetachedIndicator
77  // KDIS::DATA_TYPE::AttachedPart::GetDetachedIndicator
78  //!Description: Indicates whether an attached part is attached or detached.
79  //! This field shall be set to Attached(0) to indicate the part
80  //! is attached and to Detached(1) if the part becomes detached.
81  // Parameter: KUINT8 DI
82  //************************************
83  void SetDetachedIndicator( KUINT8 DI );
84  KUINT8 GetDetachedIndicator() const;
85 
86  //************************************
87  // FullName: KDIS::DATA_TYPE::AttachedPart::SetPartAttachedToID
88  // KDIS::DATA_TYPE::AttachedPart::GetPartAttachedToID
89  //!Description: The identification of the articulated or attached part to
90  //! which this attached part is attached.
91  //! Should contain the value zero if the attached part is
92  //! attached directly to the entity.
93  // Parameter: KUINT16 ID
94  //************************************
95  void SetPartAttachedToID( KUINT16 ID );
96  KUINT16 GetPartAttachedToID() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::AttachedPart::SetAttachedPartParameterType
100  // KDIS::DATA_TYPE::AttachedPart::GetAttachedPartParameterType
101  // KDIS::DATA_TYPE::AttachedPart::GetAttachedPartParameterTypeInt
102  //!Description: The location (or station) to which the part is attached.
103  //! See AttachedPartParameterType for further details.
104  // Parameter: AttachedPartParameterType APPT, KUINT32 APPT
105  //************************************
106  void SetAttachedPartParameterType( AttachedPartParameterType APPT );
107  void SetAttachedPartParameterType( KUINT32 APPT );
108  AttachedPartParameterType GetAttachedPartParameterType() const;
109  KUINT32 GetAttachedPartParameterTypeInt() const;
110 
111  //************************************
112  // FullName: KDIS::PDU::AttachedPart::SetAttachedPartType
113  // KDIS::PDU::AttachedPart::GetAttachedPartType
114  //!Description: Entity Type record enumeration of the attached part.
115  //! E.G This could be the type of missile that is attached to an entity wing.
116  // Parameter: const EntityType & Type
117  //************************************
118  void SetAttachedPartType( const EntityType & Type );
119  const EntityType & GetAttachedPartType() const;
120  EntityType & GetAttachedPartType();
121 
122  //************************************
123  // FullName: KDIS::DATA_TYPE::AttachedPart::GetAsString
124  //!Description: Returns a string representation.
125  //************************************
126  virtual KString GetAsString() const;
127 
128  //************************************
129  // FullName: KDIS::DATA_TYPE::AttachedPart::Decode
130  //!Description: Convert From Network Data.
131  // Parameter: KDataStream & stream
132  //************************************
133  virtual void Decode( KDataStream & stream ) throw( KException );
134 
135  //************************************
136  // FullName: KDIS::DATA_TYPE::AttachedPart::Encode
137  //!Description: Convert To Network Data.
138  // Parameter: KDataStream & stream
139  //************************************
140  virtual KDataStream Encode() const;
141  virtual void Encode( KDataStream & stream ) const;
142 
143  KBOOL operator == ( const AttachedPart & Value ) const;
144  KBOOL operator != ( const AttachedPart & Value ) const;
145 };
146 
147 } // END namespace DATA_TYPES
148 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
Definition: EntityType.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT32 m_ui32APPT
Definition: AttachedPart.h:59
KUINT16 m_ui16PartAttachedToID
Definition: AttachedPart.h:57
KUINT8 m_ui8DetachedIndicator
Definition: AttachedPart.h:55
Definition: KDefines.h:182
Definition: KDataStream.h:48
EntityType m_AttachedPartType
Definition: AttachedPart.h:61
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
AttachedPartParameterType
Definition: EnumEntityInfoInteraction.h:593
Definition: AttachedPart.h:51
Definition: VariableParameter.h:67