OpenDDS  Snapshot(2023/04/28-20:55)
TransportReplacedElement.inl
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 "EntryExit.h"
9 
11 
15  MessageBlockAllocator* mb_allocator,
16  DataBlockAllocator* db_allocator)
18  , mb_allocator_ (mb_allocator)
19  , db_allocator_ (db_allocator)
20 {
21  DBG_ENTRY_LVL("TransportReplacedElement", "TransportReplacedElement", 6);
22 
23  // Obtain the publisher id.
24  publisher_id_ = orig_elem->publication_id();
25 
26  msg_.reset(TransportQueueElement::clone_mb(orig_elem->msg(),
27  mb_allocator_,
28  db_allocator_));
29 }
30 
34 {
35  DBG_ENTRY_LVL("TransportReplacedElement", "publication_id", 6);
36  return publisher_id_;
37 }
38 
42 {
43  DBG_ENTRY_LVL("TransportReplacedElement", "duplicate_msg", 6);
44  return msg_->duplicate();
45 }
46 
48 const ACE_Message_Block*
50 {
51  DBG_ENTRY_LVL("TransportReplacedElement", "msg", 6);
52  return msg_.get();
53 }
54 
56 const ACE_Message_Block*
58 {
59  DBG_ENTRY_LVL("TransportReplacedElement", "msg_payload", 6);
60  return msg_->cont();
61 }
62 
64 bool
66 {
67  return true;
68 }
69 
71 bool
73 {
74  return true;
75 }
76 
TransportReplacedElement(TransportQueueElement *orig_elem, MessageBlockAllocator *mb_allocator=0, DataBlockAllocator *db_allocator=0)
GUID_t publisher_id_
The publication_id() from the original TransportQueueElement.
virtual GUID_t publication_id() const
Accessor for the publisher id.
ACE_Message_Block * cont(void) const
virtual ACE_Message_Block * duplicate(void) const
Message_Block_Ptr msg_
A deep-copy of the msg() from the original TransportQueueElement.
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
virtual bool owned_by_transport()
Is the sample created by the transport?
virtual const ACE_Message_Block * msg() const
Accessor for the ACE_Message_Block.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual GUID_t publication_id() const =0
Accessor for the publication id that sent the sample.
#define ACE_INLINE
virtual const ACE_Message_Block * msg_payload() const
The marshalled payload only (sample data)
virtual ACE_Message_Block * duplicate_msg() const
A reference-incremented duplicate of the marshalled sample (sample header + sample data) ...
Base wrapper class around a data/control sample to be sent.
virtual const ACE_Message_Block * msg() const =0
The marshalled sample (sample header + sample data)