00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_DCPS_TRANSPORTREPLACEDELEMENT_H 00009 #define OPENDDS_DCPS_TRANSPORTREPLACEDELEMENT_H 00010 00011 #include "dds/DCPS/dcps_export.h" 00012 #include "TransportQueueElement.h" 00013 #include "dds/DCPS/Message_Block_Ptr.h" 00014 #include "ace/Synch_Traits.h" 00015 00016 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 namespace OpenDDS { 00019 namespace DCPS { 00020 00021 class OpenDDS_Dcps_Export TransportReplacedElement 00022 : public TransportQueueElement { 00023 public: 00024 00025 TransportReplacedElement(TransportQueueElement* orig_elem, 00026 MessageBlockAllocator* mb_allocator = 0, 00027 DataBlockAllocator* db_allocator = 0); 00028 virtual ~TransportReplacedElement(); 00029 00030 /// Accessor for the publisher id. 00031 virtual RepoId publication_id() const; 00032 00033 /// Accessor for the ACE_Message_Block 00034 virtual const ACE_Message_Block* msg() const; 00035 00036 virtual const ACE_Message_Block* msg_payload() const; 00037 00038 virtual bool owned_by_transport(); 00039 00040 protected: 00041 00042 virtual void release_element(bool dropped_by_transport); 00043 00044 private: 00045 /// Cached allocator for DataSampleHeader message block 00046 MessageBlockAllocator* mb_allocator_; 00047 /// Cached allocator for DataSampleHeader data block 00048 DataBlockAllocator* db_allocator_; 00049 00050 /// The publication_id() from the original TransportQueueElement 00051 RepoId publisher_id_; 00052 00053 /// A deep-copy of the msg() from the original TransportQueueElement. 00054 Message_Block_Ptr msg_; 00055 }; 00056 00057 } // namespace DCPS 00058 } // namespace OpenDDS 00059 00060 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00061 00062 #if defined (__ACE_INLINE__) 00063 #include "TransportReplacedElement.inl" 00064 #endif /* __ACE_INLINE__ */ 00065 00066 #endif /* OPENDDS_DCPS_TRANSPORTREPLACEDELEMENT_H */