OpenDDS  Snapshot(2023/04/28-20:55)
TransportCustomizedElement.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/
10 #include "TransportSendListener.h"
11 #include "TransportSendElement.h"
12 
13 #if !defined (__ACE_INLINE__)
15 #endif /* __ACE_INLINE__ */
16 
18 
19 namespace OpenDDS {
20 namespace DCPS {
21 
23 {
24  DBG_ENTRY_LVL("TransportCustomizedElement", "~TransportCustomizedElement", 6);
25 }
26 
27 void
29 {
30  DBG_ENTRY_LVL("TransportCustomizedElement", "release_element", 6);
31  TransportQueueElement* decided = 0;
32  if (orig_) {
33  decided = orig_;
34  }
35 
36  delete this;
37 
38  if (decided) {
39  decided->decision_made(dropped_by_transport);
40  }
41 }
42 
45 {
46  DBG_ENTRY_LVL("TransportCustomizedElement", "duplicate_msg", 6);
47  return msg_->duplicate();
48 }
49 
50 const ACE_Message_Block*
52 {
53  DBG_ENTRY_LVL("TransportCustomizedElement", "msg", 6);
54  return msg_.get();
55 }
56 
57 void
59 {
60  DBG_ENTRY_LVL("TransportCustomizedElement", "set_msg", 6);
61  msg_.reset(m.release());
62 }
63 
64 const ACE_Message_Block*
66 {
67  DBG_ENTRY_LVL("TransportCustomizedElement", "msg_payload", 6);
68  return orig_ ? orig_->msg_payload() : 0;
69 }
70 
73 {
74  const TransportSendElement* ose =
75  dynamic_cast<const TransportSendElement*>(orig);
76  if (!ose) {
77  const TransportCustomizedElement* tce =
78  dynamic_cast<const TransportCustomizedElement*>(orig);
79  return tce ? tce->original_send_element() : 0;
80  }
81  return ose;
82 }
83 
86 {
88 }
89 
90 bool
92 {
94 }
95 
96 
97 } // namespace DCPS
98 } // namespace OpenDDS
99 
virtual const ACE_Message_Block * msg() const
The marshalled sample (sample header + sample data)
const TransportSendElement * original_send_element() const
virtual void release_element(bool dropped_by_transport)
Invoked when the counter reaches 0.
virtual ACE_Message_Block * duplicate_msg() const
A reference-incremented duplicate of the marshalled sample (sample header + sample data) ...
bool decision_made(bool dropped_by_transport)
Common logic for data_dropped() and data_delivered().
virtual const ACE_Message_Block * msg_payload() const
The marshalled payload only (sample data)
virtual ACE_Message_Block * duplicate(void) const
virtual bool is_last_fragment() const
Is this QueueElement the last result of fragmentation?
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
static const TransportSendElement * find_original_send_element(TransportQueueElement *orig)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
virtual bool is_last_fragment() const
Is this QueueElement the last result of fragmentation?
Base wrapper class around a data/control sample to be sent.
virtual const ACE_Message_Block * msg_payload() const =0
The marshalled payload only (sample data)