TransportSendElement.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 "TransportSendElement.h"
00010 #include "TransportSendListener.h"
00011 
00012 #if !defined (__ACE_INLINE__)
00013 #include "TransportSendElement.inl"
00014 #endif /* __ACE_INLINE__ */
00015 
00016 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00017 
00018 OpenDDS::DCPS::TransportSendElement::~TransportSendElement()
00019 {
00020   DBG_ENTRY_LVL("TransportSendElement","~TransportSendElement",6);
00021 }
00022 
00023 void
00024 OpenDDS::DCPS::TransportSendElement::release_element(bool dropped_by_transport)
00025 {
00026   DBG_ENTRY_LVL("TransportSendElement","release_element",6);
00027 
00028   if (this->was_dropped()) {
00029     this->element_->get_send_listener()->data_dropped(this->element_,
00030                                                  dropped_by_transport);
00031 
00032   } else {
00033     this->element_->get_send_listener()->data_delivered(this->element_);
00034   }
00035 
00036 
00037   delete this;
00038 }
00039 
00040 OpenDDS::DCPS::RepoId
00041 OpenDDS::DCPS::TransportSendElement::publication_id() const
00042 {
00043   DBG_ENTRY_LVL("TransportSendElement","publication_id",6);
00044   return this->element_->get_pub_id();
00045 }
00046 
00047 OpenDDS::DCPS::RepoId
00048 OpenDDS::DCPS::TransportSendElement::subscription_id() const
00049 {
00050   if (this->element_->get_num_subs() == 1) {
00051     return this->element_->get_sub_id(0);
00052   }
00053   return GUID_UNKNOWN;
00054 }
00055 
00056 const ACE_Message_Block*
00057 OpenDDS::DCPS::TransportSendElement::msg() const
00058 {
00059   DBG_ENTRY_LVL("TransportSendElement","msg",6);
00060   return this->element_->get_sample();
00061 }
00062 
00063 const ACE_Message_Block*
00064 OpenDDS::DCPS::TransportSendElement::msg_payload() const
00065 {
00066   DBG_ENTRY_LVL("TransportSendElement", "msg_payload", 6);
00067   return this->element_->get_sample() ? this->element_->get_sample()->cont() : 0;
00068 }
00069 
00070 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