Line data Source code
1 : /* 2 : * 3 : * 4 : * Distributed under the OpenDDS License. 5 : * See: http://www.opendds.org/license.html 6 : */ 7 : 8 : #include "DCPS/DdsDcps_pch.h" //Only the _pch include should start with DCPS/ 9 : #include "InstanceDataSampleList.h" 10 : #include "DataSampleElement.h" 11 : #include "Definitions.h" 12 : #include "PublicationInstance.h" 13 : 14 : #include "transport/framework/TransportSendListener.h" 15 : 16 : #if !defined (__ACE_INLINE__) 17 : #include "InstanceDataSampleList.inl" 18 : #endif /* __ACE_INLINE__ */ 19 : 20 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 21 : 22 : namespace OpenDDS { 23 : namespace DCPS { 24 : 25 : bool 26 0 : InstanceDataSampleList::on_some_list(const DataSampleElement* iter) 27 : { 28 0 : return iter->next_instance_sample_ || iter->previous_instance_sample_ 29 0 : || (iter->handle_ && iter->handle_->samples_.head_ == iter); 30 : } 31 : 32 : bool 33 0 : InstanceDataSampleList::dequeue(const DataSampleElement* stale) 34 : { 35 0 : if (head_ == 0) { 36 0 : return false; 37 : } 38 : 39 0 : if (stale == head_) { 40 : DataSampleElement* tmp; 41 0 : return dequeue_head(tmp); 42 : } 43 : 44 0 : if (stale == tail_) { 45 0 : tail_ = tail_->previous_instance_sample_; 46 0 : tail_->next_instance_sample_ = 0; 47 : 48 : } else { 49 0 : stale->previous_instance_sample_->next_instance_sample_ = 50 0 : stale->next_instance_sample_; 51 0 : stale->next_instance_sample_->previous_instance_sample_ = 52 0 : stale->previous_instance_sample_; 53 : } 54 : 55 0 : stale->next_instance_sample_ = stale->previous_instance_sample_ = 0; 56 0 : --size_; 57 0 : return true; 58 : } 59 : 60 : 61 : } // namespace DCPS 62 : } // namespace OpenDDS 63 : 64 : OPENDDS_END_VERSIONED_NAMESPACE_DECL