OpenDDS  Snapshot(2023/04/28-20:55)
RtpsTransportHeader.cpp
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #include "RtpsTransportHeader.h"
9 
10 #include "dds/DCPS/Serializer.h"
11 #include "dds/DCPS/RTPS/RtpsCoreTypeSupportImpl.h"
12 
13 #ifndef __ACE_INLINE__
14 #include "RtpsTransportHeader.inl"
15 #endif
16 
17 namespace {
19 }
20 
22 
23 namespace OpenDDS {
24 namespace DCPS {
25 
26 void
28 {
29  // Byte order doesn't matter for RTPS::Header, since it's
30  // exclusively structs/arrays of octet.
32  valid_ = (ser >> header_);
33 
34  if (valid_) {
35 
36  // length_ started as the total number of bytes in the datagram's payload.
37  // When we return to the TransportReceiveStrategy it must be the number
38  // of bytes remaining after processing this RTPS::Header.
40 
41  // RTPS spec v2.1 section 8.3.6.3
42  valid_ = std::equal(header_.prefix, header_.prefix + sizeof(header_.prefix),
45  }
46 }
47 
48 const SequenceNumber&
50 {
51  return dummy;
52 }
53 
54 }
55 }
56 
const ACE_CDR::Octet PROTOCOL_RTPS[]
Definition: MessageTypes.h:58
const ProtocolVersion_t PROTOCOLVERSION
Definition: MessageTypes.h:67
ProtocolVersion_t version
Definition: RtpsCore.idl:656
Class to serialize and deserialize data for DDS.
Definition: Serializer.h:369
OctetArray4 prefix
Definition: RtpsCore.idl:655
Sequence number abstraction. Only allows positive 64 bit values.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
void init(ACE_Message_Block &mb)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28