KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Set_Record_R_PDU.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: Set_Record_R_PDU
32  DIS: (6) 1278.1A - 1998
33  created: 12:05:2009
34  author: Karl Jones
35 
36  purpose: Used when initializing or changing internal parameter.
37  size: 288 bits/ 36 octets - not including record set sizes
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./../Simulation_Management/Simulation_Management_Header.h"
43 #include "./Reliability_Header.h"
44 #include "./../../DataTypes/RecordSet.h"
45 
46 namespace KDIS {
47 namespace PDU {
48 
50  public Reliability_Header
51 {
52 protected:
53 
55 
57 
59 
61 
63 
64  std::vector<KDIS::DATA_TYPE::RecordSet> m_vRecs;
65 
66 public:
67 
68  static const KUINT16 SET_RECORD_R_PDU_SIZE = 40;
69 
71 
72  Set_Record_R_PDU( const Header & H );
73 
74  Set_Record_R_PDU( KDataStream & stream ) throw( KException );
75 
76  Set_Record_R_PDU( const Header & H, KDataStream & stream ) throw( KException );
77 
78  Set_Record_R_PDU( const KDIS::DATA_TYPE::EntityIdentifier & OriginatingEntityID, const KDIS::DATA_TYPE::EntityIdentifier & ReceivingEntityID,
80 
81  virtual ~Set_Record_R_PDU();
82 
83  //************************************
84  // FullName: KDIS::PDU::Set_Record_R_PDU::SetRequestID
85  // KDIS::PDU::Set_Record_R_PDU::GetRequestID
86  //!Description: Request ID
87  // Parameter: KUINT32 ID
88  //************************************
89  void SetRequestID( KUINT32 ID );
90  KUINT32 GetRequestID() const;
91 
92  //************************************
93  // FullName: KDIS::PDU::Set_Record_R_PDU::GetNumberOfRecords
94  //!Description: Returns number of records.
95  //************************************
96  KUINT32 GetNumberOfRecords() const;
97 
98  //************************************
99  // FullName: KDIS::PDU::Set_Record_R_PDU::AddRecordSet
100  // KDIS::PDU::Set_Record_R_PDU::SetRecordSets
101  // KDIS::PDU::Set_Record_R_PDU::GetRecordSets
102  //!Description:
103  // Parameter: const RecordSet & RS, vector<RecordSet> & RC
104  //************************************
105  void AddRecordSet( const KDIS::DATA_TYPE::RecordSet & RS );
106  void SetRecordSets( const std::vector<KDIS::DATA_TYPE::RecordSet> & RS );
107  const std::vector<KDIS::DATA_TYPE::RecordSet> & GetRecordSets() const;
108 
109  //************************************
110  // FullName: KDIS::PDU::Set_Record_R_PDU::GetAsString
111  //!Description: Returns a string representation of the PDU.
112  //************************************
113  virtual KString GetAsString() const;
114 
115  //************************************
116  // FullName: KDIS::PDU::Set_Record_R_PDU::Decode
117  //!Description: Convert From Network Data.
118  // Parameter: KDataStream & stream
119  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
120  //************************************
121  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
122 
123  //************************************
124  // FullName: KDIS::PDU::Set_Record_R_PDU::Encode
125  //!Description: Convert To Network Data.
126  // Parameter: KDataStream & stream
127  //************************************
128  virtual KDataStream Encode() const;
129  virtual void Encode( KDataStream & stream ) const;
130 
131  KBOOL operator == ( const Set_Record_R_PDU & Value ) const;
132  KBOOL operator != ( const Set_Record_R_PDU & Value ) const;
133 };
134 
135 } // END namespace PDU
136 } // END namespace KDIS
std::vector< KDIS::DATA_TYPE::RecordSet > m_vRecs
Definition: Set_Record_R_PDU.h:64
unsigned int KUINT32
Definition: KDefines.h:103
Definition: Simulation_Management_Header.h:48
Definition: Set_Record_R_PDU.h:49
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT32 m_ui32NumRecSets
Definition: Set_Record_R_PDU.h:56
RequiredReliabilityService
Definition: EnumSimulationManagement.h:64
Definition: Reliability_Header.h:50
Definition: KDefines.h:182
Definition: KDataStream.h:48
KUINT16 m_ui16Padding
Definition: Set_Record_R_PDU.h:60
KUINT32 m_ui32RqId
Definition: Set_Record_R_PDU.h:54
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
Definition: RecordSet.h:47
Definition: Header7.h:142
unsigned char KUINT8
Definition: KDefines.h:99
KUINT32 m_ui32Padding
Definition: Set_Record_R_PDU.h:62
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8Padding
Definition: Set_Record_R_PDU.h:58