InstanceDataSampleList.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 "InstanceDataSampleList.h"
00010 #include "DataSampleElement.h"
00011 #include "Definitions.h"
00012 #include "PublicationInstance.h"
00013 
00014 #include "dds/DCPS/transport/framework/TransportSendListener.h"
00015 
00016 #if !defined (__ACE_INLINE__)
00017 #include "InstanceDataSampleList.inl"
00018 #endif /* __ACE_INLINE__ */
00019 
00020 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 namespace OpenDDS {
00023 namespace DCPS {
00024 
00025 bool
00026 InstanceDataSampleList::on_some_list(const DataSampleElement* iter)
00027 {
00028   return iter->next_instance_sample_ || iter->previous_instance_sample_
00029     || (iter->handle_ && iter->handle_->samples_.head_ == iter);
00030 }
00031 
00032 bool
00033 InstanceDataSampleList::dequeue(const DataSampleElement* stale)
00034 {
00035   if (head_ == 0) {
00036     return false;
00037   }
00038 
00039   if (stale == head_) {
00040     DataSampleElement* tmp;
00041     return dequeue_head(tmp);
00042   }
00043 
00044   if (stale == tail_) {
00045     tail_ = tail_->previous_instance_sample_;
00046     tail_->next_instance_sample_ = 0;
00047 
00048   } else {
00049     stale->previous_instance_sample_->next_instance_sample_ =
00050       stale->next_instance_sample_;
00051     stale->next_instance_sample_->previous_instance_sample_ =
00052       stale->previous_instance_sample_;
00053   }
00054 
00055   stale->next_instance_sample_ = stale->previous_instance_sample_ = 0;
00056   --size_;
00057   return true;
00058 }
00059 
00060 
00061 } // namespace DCPS
00062 } // namespace OpenDDS
00063 
00064 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