TransportQueueElement.inl
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "ace/Message_Block.h"
00009 #include "EntryExit.h"
00010
00011 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00012
00013 namespace OpenDDS {
00014 namespace DCPS {
00015
00016 ACE_INLINE
00017 TransportQueueElement::TransportQueueElement(unsigned long initial_count)
00018 : sub_loan_count_(initial_count),
00019 dropped_(false),
00020 released_(false)
00021 {
00022 DBG_ENTRY_LVL("TransportQueueElement", "TransportQueueElement", 6);
00023 }
00024
00025 ACE_INLINE
00026 bool
00027 TransportQueueElement::data_dropped(bool dropped_by_transport)
00028 {
00029 DBG_ENTRY_LVL("TransportQueueElement", "data_dropped", 6);
00030 this->dropped_ = true;
00031 return this->decision_made(dropped_by_transport);
00032 }
00033
00034 ACE_INLINE
00035 bool
00036 TransportQueueElement::data_delivered()
00037 {
00038 DBG_ENTRY_LVL("TransportQueueElement", "data_delivered", 6);
00039
00040
00041
00042 return this->decision_made(this->dropped_);
00043 }
00044
00045 ACE_INLINE
00046 bool
00047 TransportQueueElement::decision_made(bool dropped_by_transport)
00048 {
00049 DBG_ENTRY_LVL("TransportQueueElement", "decision_made", 6);
00050
00051 const unsigned long new_count = --this->sub_loan_count_;
00052 if (new_count == 0) {
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 this->release_element(dropped_by_transport);
00063 return true;
00064 }
00065
00066
00067
00068
00069
00070
00071
00072 return false;
00073 }
00074
00075 ACE_INLINE
00076 bool
00077 TransportQueueElement::was_dropped() const
00078 {
00079 return this->dropped_;
00080 }
00081
00082 ACE_INLINE
00083 bool
00084 TransportQueueElement::released() const
00085 {
00086 return this->released_;
00087 }
00088
00089 ACE_INLINE
00090 void
00091 TransportQueueElement::released(bool flag)
00092 {
00093 this->released_ = flag;
00094 }
00095
00096 ACE_INLINE
00097 bool
00098 TransportQueueElement::MatchOnPubId::matches(
00099 const TransportQueueElement& candidate) const
00100 {
00101 return this->pub_id_ == candidate.publication_id()
00102 && this->pub_id_ != GUID_UNKNOWN;
00103 }
00104
00105 ACE_INLINE
00106 bool
00107 TransportQueueElement::MatchOnDataPayload::matches(
00108 const TransportQueueElement& candidate) const
00109 {
00110 if (!candidate.msg_payload()) {
00111 return false;
00112 }
00113 return this->data_ == candidate.msg_payload()->rd_ptr();
00114 }
00115
00116 }
00117 }
00118
00119 OPENDDS_END_VERSIONED_NAMESPACE_DECL