OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
OpenDDS::DCPS::TransportSendElement Class Reference

#include <TransportSendElement.h>

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

Public Member Functions

 TransportSendElement (int initial_count, const DataSampleElement *sample)
 
virtual ~TransportSendElement ()
 
virtual GUID_t publication_id () const
 Accessor for the publisher id. More...
 
virtual GUID_t subscription_id () const
 Accessor for the subscription id, if sent the sample is sent to 1 sub. More...
 
virtual ACE_Message_Blockduplicate_msg () const
 A reference-incremented duplicate of the marshalled sample (sample header + sample data) More...
 
virtual const ACE_Message_Blockmsg () const
 Accessor for the ACE_Message_Block. More...
 
virtual const ACE_Message_Blockmsg_payload () const
 The marshalled payload only (sample data) More...
 
virtual SequenceNumber sequence () const
 
const DataSampleElementsample () const
 Original sample from send listener. More...
 
virtual bool owned_by_transport ()
 Is the sample created by the transport? More...
 
virtual bool is_last_fragment () const
 Is this QueueElement the last result of fragmentation? More...
 
- Public Member Functions inherited from OpenDDS::DCPS::TransportQueueElement
virtual ~TransportQueueElement ()
 
bool data_dropped (bool dropped_by_transport=false)
 
bool data_delivered ()
 
void increment_loan ()
 
virtual bool requires_exclusive_packet () const
 Does the sample require an exclusive transport packet? More...
 
virtual bool is_control (GUID_t pub_id) const
 Is the element a "control" sample from the specified pub_id? More...
 
bool released () const
 Is the listener get called ? More...
 
void released (bool flag)
 
virtual TqePair fragment (size_t size)
 
virtual bool is_fragment () const
 Is this QueueElement the result of fragmentation? More...
 
virtual bool is_request_ack () const
 
virtual bool is_retained_replaced () const
 

Protected Member Functions

virtual void release_element (bool dropped_by_transport)
 Invoked when the counter reaches 0. More...
 
- Protected Member Functions inherited from OpenDDS::DCPS::TransportQueueElement
 TransportQueueElement (unsigned long initial_count)
 
bool was_dropped () const
 

Private Attributes

const DataSampleElementelement_
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenDDS::DCPS::TransportQueueElement
static ACE_Message_Blockclone_mb (const ACE_Message_Block *msg, MessageBlockAllocator *mb_allocator, DataBlockAllocator *db_allocator)
 

Detailed Description

Definition at line 20 of file TransportSendElement.h.

Constructor & Destructor Documentation

◆ TransportSendElement()

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE OpenDDS::DCPS::TransportSendElement::TransportSendElement ( int  initial_count,
const DataSampleElement sample 
)

Definition at line 13 of file TransportSendElement.inl.

References ACE_INLINE, and DBG_ENTRY_LVL.

15  : TransportQueueElement(initial_count),
17 {
18  DBG_ENTRY_LVL("TransportSendElement", "TransportSendElement", 6);
19 }
TransportQueueElement(unsigned long initial_count)
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
const DataSampleElement * sample() const
Original sample from send listener.

◆ ~TransportSendElement()

OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL OpenDDS::DCPS::TransportSendElement::~TransportSendElement ( )
virtual

Definition at line 18 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL.

19 {
20  DBG_ENTRY_LVL("TransportSendElement", "~TransportSendElement", 6);
21 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

Member Function Documentation

◆ duplicate_msg()

ACE_Message_Block * OpenDDS::DCPS::TransportSendElement::duplicate_msg ( ) const
virtual

A reference-incremented duplicate of the marshalled sample (sample header + sample data)

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 56 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL, ACE_Message_Block::duplicate(), element_, and OpenDDS::DCPS::DataSampleElement::get_sample().

57 {
58  DBG_ENTRY_LVL("TransportSendElement", "duplicate_msg", 6);
59  return element_->get_sample()->duplicate();
60 }
virtual ACE_Message_Block * duplicate(void) const
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ is_last_fragment()

virtual bool OpenDDS::DCPS::TransportSendElement::is_last_fragment ( ) const
inlinevirtual

Is this QueueElement the last result of fragmentation?

Reimplemented from OpenDDS::DCPS::TransportQueueElement.

Definition at line 47 of file TransportSendElement.h.

Referenced by OpenDDS::DCPS::TransportCustomizedElement::is_last_fragment().

47 { return !element_->get_header().more_fragments(); }
const DataSampleHeader & get_header() const

◆ msg()

const ACE_Message_Block * OpenDDS::DCPS::TransportSendElement::msg ( void  ) const
virtual

Accessor for the ACE_Message_Block.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 63 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL, element_, and OpenDDS::DCPS::DataSampleElement::get_sample().

Referenced by OpenDDS::DCPS::DataLinkSet::send().

64 {
65  DBG_ENTRY_LVL("TransportSendElement", "msg", 6);
66  return element_->get_sample();
67 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ msg_payload()

const ACE_Message_Block * OpenDDS::DCPS::TransportSendElement::msg_payload ( ) const
virtual

The marshalled payload only (sample data)

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 70 of file TransportSendElement.cpp.

References ACE_Message_Block::cont(), DBG_ENTRY_LVL, element_, OpenDDS::DCPS::DataSampleElement::get_sample(), and OPENDDS_END_VERSIONED_NAMESPACE_DECL.

71 {
72  DBG_ENTRY_LVL("TransportSendElement", "msg_payload", 6);
73  return element_->get_sample() ? element_->get_sample()->cont() : 0;
74 }
ACE_Message_Block * cont(void) const
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ owned_by_transport()

ACE_INLINE bool OpenDDS::DCPS::TransportSendElement::owned_by_transport ( )
virtual

Is the sample created by the transport?

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 24 of file TransportSendElement.inl.

References ACE_INLINE.

25 {
26  return false;
27 }

◆ publication_id()

OpenDDS::DCPS::GUID_t OpenDDS::DCPS::TransportSendElement::publication_id ( ) const
virtual

Accessor for the publisher id.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 40 of file TransportSendElement.cpp.

References DBG_ENTRY_LVL, element_, and OpenDDS::DCPS::DataSampleElement::get_pub_id().

41 {
42  DBG_ENTRY_LVL("TransportSendElement", "publication_id", 6);
43  return element_->get_pub_id();
44 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ release_element()

void OpenDDS::DCPS::TransportSendElement::release_element ( bool  dropped_by_transport)
protectedvirtual

Invoked when the counter reaches 0.

Implements OpenDDS::DCPS::TransportQueueElement.

Definition at line 24 of file TransportSendElement.cpp.

References OpenDDS::DCPS::TransportSendListener::data_delivered(), OpenDDS::DCPS::TransportSendListener::data_dropped(), DBG_ENTRY_LVL, element_, OpenDDS::DCPS::DataSampleElement::get_send_listener(), and OpenDDS::DCPS::TransportQueueElement::was_dropped().

25 {
26  DBG_ENTRY_LVL("TransportSendElement", "release_element", 6);
27 
28  if (element_->get_send_listener()) {
29  if (was_dropped()) {
30  element_->get_send_listener()->data_dropped(element_, dropped_by_transport);
31  } else {
33  }
34  }
35 
36  delete this;
37 }
virtual void data_delivered(const DataSampleElement *sample)
virtual void data_dropped(const DataSampleElement *sample, bool dropped_by_transport)
TransportSendListener * get_send_listener() const
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ sample()

ACE_INLINE const OpenDDS::DCPS::DataSampleElement * OpenDDS::DCPS::TransportSendElement::sample ( ) const

◆ sequence()

ACE_INLINE OpenDDS::DCPS::SequenceNumber OpenDDS::DCPS::TransportSendElement::sequence ( ) const
virtual

◆ subscription_id()

OpenDDS::DCPS::GUID_t OpenDDS::DCPS::TransportSendElement::subscription_id ( ) const
virtual

Accessor for the subscription id, if sent the sample is sent to 1 sub.

Reimplemented from OpenDDS::DCPS::TransportQueueElement.

Definition at line 47 of file TransportSendElement.cpp.

References element_, OpenDDS::DCPS::DataSampleElement::get_num_subs(), OpenDDS::DCPS::DataSampleElement::get_sub_id(), and OpenDDS::DCPS::GUID_UNKNOWN.

Referenced by OpenDDS::DCPS::TransportCustomizedElement::subscription_id().

48 {
49  if (element_->get_num_subs() == 1) {
50  return element_->get_sub_id(0);
51  }
52  return GUID_UNKNOWN;
53 }
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
OpenDDS::DCPS::GUID_t get_sub_id(CORBA::ULong index) const

Member Data Documentation

◆ element_

const DataSampleElement* OpenDDS::DCPS::TransportSendElement::element_
private

This is the actual element that the transport framework was asked to send.

Definition at line 57 of file TransportSendElement.h.

Referenced by duplicate_msg(), msg(), msg_payload(), publication_id(), release_element(), sample(), sequence(), and subscription_id().


The documentation for this class was generated from the following files: