OpenDDS  Snapshot(2023/04/28-20:55)
TransportSendElement.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 "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
9 #include "TransportSendElement.h"
10 #include "TransportSendListener.h"
11 
12 #if !defined (__ACE_INLINE__)
13 #include "TransportSendElement.inl"
14 #endif /* __ACE_INLINE__ */
15 
17 
19 {
20  DBG_ENTRY_LVL("TransportSendElement", "~TransportSendElement", 6);
21 }
22 
23 void
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 }
38 
41 {
42  DBG_ENTRY_LVL("TransportSendElement", "publication_id", 6);
43  return element_->get_pub_id();
44 }
45 
48 {
49  if (element_->get_num_subs() == 1) {
50  return element_->get_sub_id(0);
51  }
52  return GUID_UNKNOWN;
53 }
54 
57 {
58  DBG_ENTRY_LVL("TransportSendElement", "duplicate_msg", 6);
59  return element_->get_sample()->duplicate();
60 }
61 
62 const ACE_Message_Block*
64 {
65  DBG_ENTRY_LVL("TransportSendElement", "msg", 6);
66  return element_->get_sample();
67 }
68 
69 const ACE_Message_Block*
71 {
72  DBG_ENTRY_LVL("TransportSendElement", "msg_payload", 6);
73  return element_->get_sample() ? element_->get_sample()->cont() : 0;
74 }
75 
virtual GUID_t publication_id() const
Accessor for the publisher id.
TransportSendListener * get_send_listener() const
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
virtual const ACE_Message_Block * msg() const
Accessor for the ACE_Message_Block.
virtual ACE_Message_Block * duplicate_msg() const
A reference-incremented duplicate of the marshalled sample (sample header + sample data) ...
virtual GUID_t subscription_id() const
Accessor for the subscription id, if sent the sample is sent to 1 sub.
OpenDDS::DCPS::GUID_t get_sub_id(CORBA::ULong index) const
virtual const ACE_Message_Block * msg_payload() const
The marshalled payload only (sample data)
virtual void data_dropped(const DataSampleElement *sample, bool dropped_by_transport)
ACE_Message_Block * cont(void) const
virtual ACE_Message_Block * duplicate(void) const
virtual void release_element(bool dropped_by_transport)
Invoked when the counter reaches 0.
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual void data_delivered(const DataSampleElement *sample)