OpenDDS::DCPS::RtpsCustomizedElement Class Reference

#include <RtpsCustomizedElement.h>

Inheritance diagram for OpenDDS::DCPS::RtpsCustomizedElement:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::RtpsCustomizedElement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

SequenceNumber sequence () const
SequenceNumber last_fragment () const

Static Public Member Functions

static RtpsCustomizedElementalloc (TransportQueueElement *orig, ACE_Message_Block *msg, ACE_Allocator *allocator=0)

Private Member Functions

 RtpsCustomizedElement (TransportQueueElement *orig, ACE_Message_Block *msg, ACE_Allocator *allocator)
virtual ~RtpsCustomizedElement ()
ElementPair fragment (size_t size)
const ACE_Message_Block * msg_payload () const
 The marshalled payload only (sample data).

Private Attributes

SequenceNumber seq_
SequenceNumber last_frag_

Detailed Description

Definition at line 20 of file RtpsCustomizedElement.h.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::RtpsCustomizedElement::RtpsCustomizedElement ( TransportQueueElement orig,
ACE_Message_Block *  msg,
ACE_Allocator allocator 
) [private]

Definition at line 12 of file RtpsCustomizedElement.inl.

References OpenDDS::DCPS::TransportCustomizedElement::set_msg(), and OpenDDS::DCPS::TransportCustomizedElement::set_requires_exclusive().

Referenced by alloc().

00015   : TransportCustomizedElement(orig, false, allocator)
00016   , seq_(SequenceNumber::SEQUENCENUMBER_UNKNOWN())
00017 {
00018   set_requires_exclusive();
00019   set_msg(msg);
00020 }

OpenDDS::DCPS::RtpsCustomizedElement::~RtpsCustomizedElement (  )  [private, virtual]

Definition at line 18 of file RtpsCustomizedElement.cpp.

00019 {}


Member Function Documentation

ACE_INLINE RtpsCustomizedElement * OpenDDS::DCPS::RtpsCustomizedElement::alloc ( TransportQueueElement orig,
ACE_Message_Block *  msg,
ACE_Allocator allocator = 0 
) [static]

Definition at line 24 of file RtpsCustomizedElement.inl.

References OpenDDS::DCPS::TransportCustomizedElement::allocator(), and RtpsCustomizedElement().

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::customize_queue_element(), and fragment().

00027 {
00028   if (allocator) {
00029     RtpsCustomizedElement* ret;
00030     ACE_NEW_MALLOC_RETURN(ret,
00031       static_cast<RtpsCustomizedElement*>(allocator->malloc(0)),
00032       RtpsCustomizedElement(orig, msg, allocator),
00033       0);
00034     return ret;
00035   } else {
00036     return new RtpsCustomizedElement(orig, msg, 0);
00037   }
00038 }

ElementPair OpenDDS::DCPS::RtpsCustomizedElement::fragment ( size_t  size  )  [private, virtual]

Create two TransportQueueElements representing the same data payload as the current TransportQueueElement, with the first one (including its DataSampleHeader) fitting in "size" bytes. This method leaves the current TransportQueueElement alone (but can't be made const because the newly-created elements will need to invoke non-const methods on it). Each element in the pair will contain its own serialized modified DataSampleHeader.

Reimplemented from OpenDDS::DCPS::TransportQueueElement.

Definition at line 22 of file RtpsCustomizedElement.cpp.

References alloc(), OpenDDS::DCPS::TransportCustomizedElement::allocator(), last_frag_, OpenDDS::DCPS::TransportCustomizedElement::msg(), OpenDDS::DCPS::TransportCustomizedElement::publication_id(), seq_, sequence(), OpenDDS::DCPS::TransportCustomizedElement::set_fragment(), OpenDDS::DCPS::TransportCustomizedElement::set_publication_id(), and OpenDDS::DCPS::RtpsSampleHeader::split().

00023 {
00024   ACE_Message_Block* head;
00025   ACE_Message_Block* tail;
00026   const SequenceRange fragNumbers =
00027     RtpsSampleHeader::split(*msg(), size, head, tail);
00028 
00029   RtpsCustomizedElement* frag =
00030     RtpsCustomizedElement::alloc(0, head, allocator());
00031   frag->set_publication_id(publication_id());
00032   frag->seq_ = sequence();
00033   frag->set_fragment();
00034   frag->last_frag_ = fragNumbers.first;
00035 
00036   RtpsCustomizedElement* rest =
00037     RtpsCustomizedElement::alloc(this, tail, allocator());
00038   rest->set_fragment();
00039   rest->last_frag_ = fragNumbers.second;
00040 
00041   return ElementPair(frag, rest);
00042 }

ACE_INLINE SequenceNumber OpenDDS::DCPS::RtpsCustomizedElement::last_fragment (  )  const

Definition at line 50 of file RtpsCustomizedElement.inl.

References last_frag_.

00051 {
00052   return last_frag_;
00053 }

const ACE_Message_Block * OpenDDS::DCPS::RtpsCustomizedElement::msg_payload (  )  const [private, virtual]

The marshalled payload only (sample data).

Reimplemented from OpenDDS::DCPS::TransportCustomizedElement.

Definition at line 45 of file RtpsCustomizedElement.cpp.

References OpenDDS::DCPS::TransportCustomizedElement::msg().

00046 {
00047   return msg() ? msg()->cont() : 0;
00048 }

ACE_INLINE SequenceNumber OpenDDS::DCPS::RtpsCustomizedElement::sequence (  )  const [virtual]

Reimplemented from OpenDDS::DCPS::TransportCustomizedElement.

Definition at line 42 of file RtpsCustomizedElement.inl.

References seq_, OpenDDS::DCPS::TransportCustomizedElement::sequence(), and OpenDDS::DCPS::SequenceNumber::SEQUENCENUMBER_UNKNOWN().

Referenced by OpenDDS::DCPS::RtpsUdpDataLink::customize_queue_element(), and fragment().


Member Data Documentation

SequenceNumber OpenDDS::DCPS::RtpsCustomizedElement::last_frag_ [private]

Definition at line 40 of file RtpsCustomizedElement.h.

Referenced by fragment(), and last_fragment().

SequenceNumber OpenDDS::DCPS::RtpsCustomizedElement::seq_ [private]

Definition at line 40 of file RtpsCustomizedElement.h.

Referenced by fragment(), and sequence().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:35 2016 for OpenDDS by  doxygen 1.4.7