KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Reliability_Header.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: Reliability_Header
32  DIS: (6) 1278.1A - 1998
33  created: 20:01:2009
34  author: Karl Jones
35 
36  purpose: specifies the required level of reliability service to be
37  used for a PDU.
38  size: 32 bits / 4 octets
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./../../KDefines.h"
44 #include "./../../DataTypes/Enums/KDISEnums.h"
45 #include "./../../KDataStream.h"
46 
47 namespace KDIS {
48 namespace PDU {
49 
51 {
52 protected:
53 
55 
57 
59 
60 public:
61 
62  static const KUINT16 RELIABILITY_SIZE = 4;
63 
65 
66  Reliability_Header( KDataStream & stream ) throw( KException );
67 
69 
70  virtual ~Reliability_Header();
71 
72  //************************************
73  // FullName: KDIS::PDU::Reliability_Header::SetRequiredReliabilityService
74  // KDIS::PDU::Reliability_Header::GetRequiredReliabilityService
75  //!Description: specifies the required level of reliability service to be
76  //! used for this transaction/PDU.
77  // Parameter: RequiredReliabilityService RRS
78  //************************************
79  void SetRequiredReliabilityService( KDIS::DATA_TYPE::ENUMS::RequiredReliabilityService RRS );
80  KDIS::DATA_TYPE::ENUMS::RequiredReliabilityService GetRequiredReliabilityService() const;
81 
82  //************************************
83  // FullName: KDIS::PDU::Reliability_Header::GetString
84  //!Description: Returns a string representation of the PDU.
85  //************************************
86  virtual KString GetAsString() const;
87 
88  //************************************
89  // FullName: KDIS::PDU::Reliability_Header::Decode
90  //!Description: Convert From Network Data.
91  // Parameter: KDataStream & stream
92  //************************************
93  virtual void Decode( KDataStream & stream ) throw( KException );
94 
95  //************************************
96  // FullName: KDIS::PDU::Reliability_Header::Encode
97  //!Description: Convert To Network Data.
98  // Parameter: KDataStream & stream
99  //************************************
100  virtual KDataStream Encode() const;
101  virtual void Encode( KDataStream & stream ) const;
102 
103  KBOOL operator == ( const Reliability_Header & Value ) const;
104  KBOOL operator != ( const Reliability_Header & Value ) const;
105 };
106 
107 } // END namespace PDU
108 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
RequiredReliabilityService
Definition: EnumSimulationManagement.h:64
Definition: Reliability_Header.h:50
KUINT8 m_ui8ReqRelSrv
Definition: Reliability_Header.h:54
Definition: KDefines.h:182
KUINT8 m_ui8Padding
Definition: Reliability_Header.h:58
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
KUINT16 m_ui16Padding1
Definition: Reliability_Header.h:56
#define KDIS_EXPORT
Definition: KDefines.h:82