TransportCustomizedElement.cpp

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/
00009 #include "TransportCustomizedElement.h"
00010 #include "TransportSendListener.h"
00011 #include "TransportSendElement.h"
00012 
00013 #if !defined (__ACE_INLINE__)
00014 #include "TransportCustomizedElement.inl"
00015 #endif /* __ACE_INLINE__ */
00016 
00017 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00018 
00019 namespace OpenDDS {
00020 namespace DCPS {
00021 
00022 TransportCustomizedElement::~TransportCustomizedElement()
00023 {
00024   DBG_ENTRY_LVL("TransportCustomizedElement", "~TransportCustomizedElement", 6);
00025 }
00026 
00027 void
00028 TransportCustomizedElement::release_element(bool dropped_by_transport)
00029 {
00030   DBG_ENTRY_LVL("TransportCustomizedElement", "release_element", 6);
00031   TransportQueueElement* decided = 0;
00032   if (orig_) {
00033     decided = orig_;
00034   }
00035 
00036   delete this;
00037 
00038   if (decided) {
00039     decided->decision_made(dropped_by_transport);
00040   }
00041 }
00042 
00043 RepoId
00044 TransportCustomizedElement::publication_id() const
00045 {
00046   DBG_ENTRY_LVL("TransportCustomizedElement", "publication_id", 6);
00047   return publication_id_;
00048 }
00049 
00050 RepoId
00051 TransportCustomizedElement::subscription_id() const
00052 {
00053   DBG_ENTRY_LVL("TransportCustomizedElement", "subscription_id", 6);
00054   const TransportSendElement* ose = original_send_element();
00055   return ose ? ose->subscription_id() : GUID_UNKNOWN;
00056 }
00057 
00058 void
00059 TransportCustomizedElement::set_publication_id(const RepoId& id)
00060 {
00061   DBG_ENTRY_LVL("TransportCustomizedElement", "set_msg", 6);
00062   publication_id_ = id;
00063 }
00064 
00065 const ACE_Message_Block*
00066 TransportCustomizedElement::msg() const
00067 {
00068   DBG_ENTRY_LVL("TransportCustomizedElement", "msg", 6);
00069   return msg_.get();
00070 }
00071 
00072 void
00073 TransportCustomizedElement::set_msg(Message_Block_Ptr m)
00074 {
00075   DBG_ENTRY_LVL("TransportCustomizedElement", "set_msg", 6);
00076   msg_.reset(m.release());
00077 }
00078 
00079 const ACE_Message_Block*
00080 TransportCustomizedElement::msg_payload() const
00081 {
00082   DBG_ENTRY_LVL("TransportCustomizedElement", "msg_payload", 6);
00083   return orig_ ? orig_->msg_payload() : 0;
00084 }
00085 
00086 const TransportSendElement*
00087 TransportCustomizedElement::original_send_element() const
00088 {
00089   const TransportSendElement* ose =
00090     dynamic_cast<const TransportSendElement*>(orig_);
00091   if (!ose) {
00092     const TransportCustomizedElement* tce =
00093       dynamic_cast<const TransportCustomizedElement*>(orig_);
00094     return tce ? tce->original_send_element() : 0;
00095   }
00096   return ose;
00097 }
00098 
00099 } // namespace DCPS
00100 } // namespace OpenDDS
00101 
00102 OPENDDS_END_VERSIONED_NAMESPACE_DECL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1