MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
msgRetractHandleImpl.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2003 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: msgRetractHandleImpl.h,v $ $Revision: 1.7 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef msgRetractHandleImplementation_H_
13 #define msgRetractHandleImplementation_H_
14 
15 #if !defined(DtIFSPEC13)
16 
17 #include "rtiApiTypes.h"
18 
19 #include <rtiutil/rtiMsConfig.h>
20 #include <rtiutil/internalTypes.h>
21 
22 #include <RTI/VariableLengthData.h>
23 
24 #include <string>
25 #include <sstream>
26 
27 namespace RTI_API
28 {
29 
31 {
32 public:
36  MessageRetractionHandleImplementation(unsigned long fedHandleValue, unsigned long serialValue);
38 
41 
42  bool isValid() const;
43 
45  bool operator==(MessageRetractionHandleImplementation const & rhs) const;
46  bool operator!=(MessageRetractionHandleImplementation const & rhs) const;
47  bool operator< (MessageRetractionHandleImplementation const & rhs) const;
48 
51  VariableLengthData encode() const;
53  unsigned long encode(void* buffer, unsigned long bufferSize) const;
54  unsigned long encodedLength() const;
55 
57  void decode(VariableLengthData const & encodedHandle);
58 
60  void decode(void* buffer, unsigned long bufferSize);
61 
63  std::wstring toString() const;
64 
66  void setValue(DtMessageRetractionHandle retractHandle);
67  DtMessageRetractionHandle const & value() const;
68 
70  void setFederateHandle(unsigned long fedHandleValue);
71  unsigned long federateHandle() const;
72 
74  void setSerialNumber(unsigned long serialValue);
75  unsigned long serialNumber() const;
76 
77 protected:
79 };
80 
82 {
86 }
87 
89  unsigned long serialValue)
90 {
91  myRetractHandle.sendingFederate = fedHandleValue;
92  myRetractHandle.serialNumber = serialValue;
93 }
95 {
98 }
99 
102 {
105 }
106 
109 {
110  if (this == &rhs)
111  return *this;
114  return *this;
115 };
116 
118 {
120  return myRetractHandle.sendingFederate != 0;
121 }
122 
124 {
127 };
128 
130 {
133 };
134 
136 {
140 };
141 
142 inline VariableLengthData MessageRetractionHandleImplementation::encode() const
143 {
147  return VariableLengthData(&netHandle, sizeof(netHandle));
148 };
149 
150 inline unsigned long MessageRetractionHandleImplementation::encode(void* buffer, unsigned long bufferSize) const
151 {
153  if (bufferSize < sizeof(netHandle))
154  return 0;
157  memcpy(buffer, &netHandle, sizeof(netHandle));
158  return sizeof(netHandle);
159 }
161 {
162  return sizeof(DtNetMessageRetractionHandle);
163 }
164 
166 {
167  std::wstringstream ss;
169  return ss.str();
170 };
171 
173 {
175  myRetractHandle.serialNumber = retractHandle.serialNumber;
176 }
177 
179 {
180  return myRetractHandle;
181 }
182 
183 inline void MessageRetractionHandleImplementation::setFederateHandle(unsigned long fedHandleValue)
184 {
185  myRetractHandle.sendingFederate = fedHandleValue;
186 }
188 {
190 }
191 
192 inline void MessageRetractionHandleImplementation::setSerialNumber(unsigned long serialValue)
193 {
194  myRetractHandle.serialNumber = serialValue;
195 }
197 {
199 }
200 inline void MessageRetractionHandleImplementation::decode(VariableLengthData const & encodedHandle)
201 {
202  DtNetMessageRetractionHandle* netHandle = (DtNetMessageRetractionHandle*) encodedHandle.data();
205 }
206 
208  void* buffer, unsigned long bufferSize)
209 {
213 }
214 
215 };
216 
217 #endif // !DtIFSPEC13
218 #endif
void decode(VariableLengthData const &encodedHandle)
Decode VariableLengthData into self.
Definition: msgRetractHandleImpl.h:200
void setValue(DtMessageRetractionHandle retractHandle)
Set/Get implementation.
Definition: msgRetractHandleImpl.h:172
bool operator==(MessageRetractionHandleImplementation const &rhs) const
Relational operators.
Definition: msgRetractHandleImpl.h:123
void setSerialNumber(unsigned long serialValue)
Set/Get serial number.
Definition: msgRetractHandleImpl.h:192
VariableLengthData encode() const
Generate an encoded value that can be used to send handles to other federates in updates or interacti...
Definition: msgRetractHandleImpl.h:142
DtFederateHandle sendingFederate
Definition: internalTypes.h:87
DtMessageRetractionHandle myRetractHandle
Definition: msgRetractHandleImpl.h:78
unsigned long serialNumber() const
Definition: msgRetractHandleImpl.h:196
std::wstring toString() const
Return a string representation of handle.
Definition: msgRetractHandleImpl.h:165
void setFederateHandle(unsigned long fedHandleValue)
Set/Get federate handle.
Definition: msgRetractHandleImpl.h:183
unsigned long federateHandle() const
Definition: msgRetractHandleImpl.h:187
bool operator<(MessageRetractionHandleImplementation const &rhs) const
Definition: msgRetractHandleImpl.h:135
MessageRetractionHandleImplementation()
Constructors.
Definition: msgRetractHandleImpl.h:81
bool isValid() const
Definition: msgRetractHandleImpl.h:117
MessageRetractionHandleImplementation & operator=(MessageRetractionHandleImplementation const &rhs)
Assignment.
Definition: msgRetractHandleImpl.h:107
bool operator!=(MessageRetractionHandleImplementation const &rhs) const
Definition: msgRetractHandleImpl.h:129
Definition: msgRetractHandleImpl.h:30
DtHandle serialNumber
Definition: internalTypes.h:86
his file contains a class to hold an arbitrary array of bytes for encoded values, attribute values...
MAKRti::DtNetU32 sendingFederate
Definition: internalTypes.h:82
Definition: internalTypes.h:84
unsigned long encodedLength() const
Definition: msgRetractHandleImpl.h:160
MAKRti::DtNetU32 serialNumber
Definition: internalTypes.h:81
The declaration of internal types.
Definition: internalTypes.h:79
DtMessageRetractionHandle const & value() const
Definition: msgRetractHandleImpl.h:178

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)