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