OpenDDS::DCPS::SourceDataStrategy Class Reference

#include <ReceivedDataStrategy.h>

Inheritance diagram for OpenDDS::DCPS::SourceDataStrategy:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::SourceDataStrategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SourceDataStrategy (ReceivedDataElementList &rcvd_samples)
 ~SourceDataStrategy ()
virtual void add (ReceivedDataElement *data_sample)

Detailed Description

Definition at line 47 of file ReceivedDataStrategy.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::SourceDataStrategy::SourceDataStrategy ( ReceivedDataElementList rcvd_samples  )  [explicit]

Definition at line 126 of file ReceivedDataStrategy.cpp.

00128   : ReceivedDataStrategy(rcvd_samples)
00129 {}

OpenDDS::DCPS::SourceDataStrategy::~SourceDataStrategy (  ) 

Definition at line 131 of file ReceivedDataStrategy.cpp.

00132 {}


Member Function Documentation

void OpenDDS::DCPS::SourceDataStrategy::add ( ReceivedDataElement data_sample  )  [virtual]

Reimplemented from OpenDDS::DCPS::ReceivedDataStrategy.

Definition at line 135 of file ReceivedDataStrategy.cpp.

References OpenDDS::DCPS::ReceivedDataElementList::add(), OpenDDS::DCPS::ReceivedDataElementList::head_, OpenDDS::DCPS::ReceivedDataElement::next_data_sample_, OpenDDS::DCPS::ReceivedDataElement::previous_data_sample_, OpenDDS::DCPS::ReceivedDataStrategy::rcvd_samples_, OpenDDS::DCPS::ReceivedDataElementList::size_, and OpenDDS::DCPS::ReceivedDataElement::source_timestamp_.

00136 {
00137   for (ReceivedDataElement* it = this->rcvd_samples_.head_;
00138        it != 0; it = it->next_data_sample_) {
00139     if (data_sample->source_timestamp_ < it->source_timestamp_) {
00140       data_sample->previous_data_sample_ = it->previous_data_sample_;
00141       data_sample->next_data_sample_ = it;
00142 
00143       // Are we replacing the head?
00144       if (it->previous_data_sample_ == 0) {
00145         this->rcvd_samples_.head_ = data_sample;
00146 
00147       } else {
00148         it->previous_data_sample_->next_data_sample_ = data_sample;
00149       }
00150 
00151       it->previous_data_sample_ = data_sample;
00152 
00153       ++this->rcvd_samples_.size_;
00154 
00155       return;
00156     }
00157   }
00158 
00159   this->rcvd_samples_.add(data_sample);
00160 }


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:22 2016 for OpenDDS by  doxygen 1.4.7