KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Record_Query_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: Record_Query_R_PDU
32  DIS: (6) 1278.1A - 1998
33  created: 12/05/2009
34  author: Karl Jones
35 
36  purpose: A request for one or more records of data from an entity.
37  size: 320 bits/ 40 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 #include <vector>
46 
47 namespace KDIS {
48 namespace PDU {
49 
51  public Reliability_Header
52 {
53 protected:
54 
56 
58 
60 
62 
63  std::vector<KUINT32> m_vui32RecID;
64 
65 public:
66 
67  static const KUINT16 RECORD_QUERY_R_PDU_SIZE = 40;
68 
70 
71  Record_Query_R_PDU( KDataStream & stream ) throw( KException );
72 
73  Record_Query_R_PDU( const Header & H, KDataStream & stream ) throw( KException );
74 
75  Record_Query_R_PDU( const KDIS::DATA_TYPE::EntityIdentifier & OriginatingEntityID, const KDIS::DATA_TYPE::EntityIdentifier & ReceivingEntityID, KUINT32 RequestID,
77 
78  virtual ~Record_Query_R_PDU();
79 
80  //************************************
81  // FullName: KDIS::PDU::Record_Query_R_PDU::SetRequestID
82  // KDIS::PDU::Record_Query_R_PDU::GetRequestID
83  //!Description: Request ID
84  // Parameter: KUINT32 ID
85  //************************************
86  void SetRequestID( KUINT32 ID );
87  KUINT32 GetRequestID() const;
88 
89  //************************************
90  // FullName: KDIS::PDU::Record_Query_R_PDU::SetEventType
91  // KDIS::PDU::Record_Query_R_PDU::GetEventType
92  //!Description: Event type
93  // Parameter: EventType ET
94  //************************************
95  void SetEventType( KDIS::DATA_TYPE::ENUMS::EventType ET );
96  KDIS::DATA_TYPE::ENUMS::EventType GetEventType() const;
97 
98  //************************************
99  // FullName: KDIS::PDU::Record_Query_R_PDU::SetTime
100  // KDIS::PDU::Record_Query_R_PDU::GetTime
101  //!Description: Specifies the time interval between issues of Record-R PDUs for periodic reporting.
102  //! This value may also represent a specific time for time-based reporting.
103  //! A value of zero in this field shall mean that the requested data should be sent
104  //! once and not at any previously specified time interval.
105  // Parameter: KUINT32 T
106  //************************************
107  void SetTime( KUINT32 T );
108  KUINT32 GetTime() const;
109 
110  //************************************
111  // FullName: KDIS::PDU::Record_Query_R_PDU::GetNumberRecords
112  //!Description: Number of Record IDs.
113  //************************************
114  KUINT32 GetNumberRecords() const;
115 
116  //************************************
117  // FullName: KDIS::PDU::Record_Query_R_PDU::AddRecordID
118  // KDIS::PDU::Record_Query_R_PDU::SetRecordIDs
119  // KDIS::PDU::Record_Query_R_PDU::GetRecordIDs
120  //!Description: Specifies the identification of the records for which information
121  //! is requested.
122  // Parameter: vector<KUINT32> & ID
123  //************************************
124  void AddRecordID( const KUINT32 ID );
125  void SetRecordIDs( const std::vector<KUINT32> & ID );
126  const std::vector<KUINT32> & GetRecordIDs() const;
127 
128  //************************************
129  // FullName: KDIS::PDU::Record_Query_R_PDU::GetAsString
130  //!Description: Returns a string representation of the PDU.
131  //************************************
132  virtual KString GetAsString() const;
133 
134  //************************************
135  // FullName: KDIS::PDU::Record_Query_R_PDU::Decode
136  //!Description: Convert From Network Data.
137  // Parameter: KDataStream & stream
138  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
139  //************************************
140  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
141 
142  //************************************
143  // FullName: KDIS::PDU::Record_Query_R_PDU::Encode
144  //!Description: Convert To Network Data.
145  // Parameter: KDataStream & stream
146  //************************************
147  virtual KDataStream Encode() const;
148  virtual void Encode( KDataStream & stream ) const;
149 
150  KBOOL operator == ( const Record_Query_R_PDU & Value ) const;
151  KBOOL operator != ( const Record_Query_R_PDU & Value ) const;
152 };
153 
154 } // END namespace PDU
155 } // END namespace KDIS
unsigned int KUINT32
Definition: KDefines.h:103
Definition: Record_Query_R_PDU.h:50
Definition: Simulation_Management_Header.h:48
EventType
Definition: EnumSimulationManagement.h:275
unsigned short int KUINT16
Definition: KDefines.h:101
RequiredReliabilityService
Definition: EnumSimulationManagement.h:64
Definition: Reliability_Header.h:50
KUINT16 m_ui16EvntTyp
Definition: Record_Query_R_PDU.h:57
Definition: KDefines.h:182
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
std::vector< KUINT32 > m_vui32RecID
Definition: Record_Query_R_PDU.h:63
KUINT32 m_ui32Time
Definition: Record_Query_R_PDU.h:59
Definition: Header7.h:142
KUINT32 m_ui32NumRecs
Definition: Record_Query_R_PDU.h:61
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT32 m_ui32RqId
Definition: Record_Query_R_PDU.h:55