1 /*********************************************************************
2 Copyright 2013 Karl Jones
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
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
30 /********************************************************************
32 DIS: (6) 1278.1A - 1998
36 purpose: Communicates separation of an entity from another entity.
37 Also provides the capability to specifically identify the station location on
38 the parent entity that the entity separated from.
39 Examples include the launch of an air-to-surface missile from the wing station
40 of a fighter aircraft, the separation of a stage of a multistage missile, and the separation
41 of a component of a smart weapon.
43 size: 128 bits / 16 octets
44 *********************************************************************/
49 #include "./VariableParameter.h"
50 #include "./EntityIdentifier.h"
51 #include "./NamedLocationIdentifier.h"
56 using KDIS::DATA_TYPE::ENUMS::ReasonForSeparation
;
57 using KDIS::DATA_TYPE::ENUMS::PreEntityIndicator
;
59 class KDIS_EXPORT SeparationPart
: public VariableParameter
65 KUINT8 m_ui8PreEntIndicator
;
69 EntityIdentifier m_ParentEntId
;
71 KUINT16 m_ui16Padding
;
73 NamedLocationIdentifier m_StationLoc
;
79 SeparationPart(ReasonForSeparation RFS
, PreEntityIndicator PEI
, const EntityIdentifier
& PEID
, const NamedLocationIdentifier
& SL
);
81 SeparationPart( KDataStream
& stream
) ;
83 virtual ~SeparationPart();
85 //************************************
86 // FullName: KDIS::DATA_TYPE::SeparationPart::SetReasonForSeparation
87 // KDIS::DATA_TYPE::SeparationPart::GetReasonForSeparation
88 // Description: Indicate the reason for the separation.
89 // Parameter: ReasonForSeparation RFS
90 //************************************
91 void SetReasonForSeparation( ReasonForSeparation RFS
);
92 ReasonForSeparation
GetReasonForSeparation() const;
94 //************************************
95 // FullName: KDIS::DATA_TYPE::SeparationPart::SetPreEntityIndicator
96 // KDIS::DATA_TYPE::SeparationPart::GetPreEntityIndicator
97 // Description: Indicates whether the entity existed prior to the separation and,
98 // if so, in what manner.
99 // Parameter: PreEntityIndicator PEI
100 //************************************
101 void SetPreEntityIndicator(PreEntityIndicator PEI
);
102 PreEntityIndicator
GetPreEntityIndicator() const;
104 //************************************
105 // FullName: KDIS::PDU::SeparationPart::SetParentEntityId
106 // KDIS::PDU::SeparationPart::GetParentEntityId
107 // Description: Entity ID of the parent entity.
108 // Parameter: const EntityIdentifier & PEID
109 //************************************
110 void SetParentEntityId(const EntityIdentifier
& PEID
);
111 const EntityIdentifier
& GetParentEntityId() const;
112 EntityIdentifier
& GetParentEntityId();
114 //************************************
115 // FullName: KDIS::PDU::SeparationPart::SetStationLocation
116 // KDIS::PDU::SeparationPart::GetStationLocation
117 // Description: Indicate the station that this entity was attached to prior to
118 // separation if known.
119 // Parameter: const NamedLocationIdentifier & SL
120 //************************************
121 void SetStationLocation(const NamedLocationIdentifier
& SL
);
122 const NamedLocationIdentifier
& GetStationLocation() const;
123 NamedLocationIdentifier
& GetStationLocation();
125 //************************************
126 // FullName: KDIS::DATA_TYPE::SeparationPart::GetAsString
127 // Description: Returns a string representation.
128 //************************************
129 virtual KString
GetAsString() const;
131 //************************************
132 // FullName: KDIS::DATA_TYPE::SeparationPart::Decode
133 // Description: Convert From Network Data.
134 // Parameter: KDataStream & stream
135 //************************************
136 virtual void Decode( KDataStream
& stream
) ;
138 //************************************
139 // FullName: KDIS::DATA_TYPE::SeparationPart::Encode
140 // Description: Convert To Network Data.
141 // Parameter: KDataStream & stream
142 //************************************
143 virtual KDataStream
Encode() const;
144 virtual void Encode( KDataStream
& stream
) const;
146 KBOOL
operator == ( const SeparationPart
& Value
) const;
147 KBOOL
operator != ( const SeparationPart
& Value
) const;
150 } // END namespace DATA_TYPES
151 } // END namespace KDIS
152 #endif // DIS_VERSION > 5