OpenDDS  Snapshot(2023/04/28-20:55)
RtpsCustomizedElement.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 
9 #include "RtpsSampleHeader.h"
10 
11 #ifndef __ACE_INLINE__
13 #endif
14 
16 
17 namespace OpenDDS {
18 namespace DCPS {
19 
21 {}
22 
24 {
25  Message_Block_Ptr head;
26  Message_Block_Ptr tail;
27  const SequenceRange fragNumbers =
28  RtpsSampleHeader::split(*msg(), size, head, tail);
29  if (fragNumbers == unknown_sequence_range) {
30  return null_tqe_pair;
31  }
32 
33  RtpsCustomizedElement* frag = new RtpsCustomizedElement(0, move(head));
34  frag->set_fragment(this);
35  frag->last_frag_ = fragNumbers.first;
36 
37  RtpsCustomizedElement* rest = new RtpsCustomizedElement(this, move(tail));
38  rest->set_fragment(this);
39  rest->last_frag_ = fragNumbers.second;
40 
41  return TqePair(frag, rest);
42 }
43 
44 const ACE_Message_Block*
46 {
47  const ACE_Message_Block* message = msg();
48  return message ? message->cont() : 0;
49 }
50 
51 }
52 }
53 
virtual const ACE_Message_Block * msg() const
The marshalled sample (sample header + sample data)
std::pair< TransportQueueElement *, TransportQueueElement * > TqePair
const ACE_Message_Block * msg_payload() const
The marshalled payload only (sample data)
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
OpenDDS_Dcps_Export const SequenceRange unknown_sequence_range
RtpsCustomizedElement(TransportQueueElement *orig, Message_Block_Ptr msg)
ACE_Message_Block * cont(void) const
const TqePair null_tqe_pair
std::pair< SequenceNumber, SequenceNumber > SequenceRange
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
static SequenceRange split(const ACE_Message_Block &orig, size_t size, Message_Block_Ptr &head, Message_Block_Ptr &tail)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28