OpenDDS::DCPS::SendStateDataSampleListConstIterator Struct Reference

SendStateDataSampleList STL-style const iterator implementation. More...

#include <SendStateDataSampleList.h>

Collaboration diagram for OpenDDS::DCPS::SendStateDataSampleListConstIterator:

Collaboration graph
[legend]
List of all members.

Public Types

typedef const DataSampleElementpointer
typedef const DataSampleElementreference

Public Member Functions

 SendStateDataSampleListConstIterator (const DataSampleElement *head, const DataSampleElement *tail, const DataSampleElement *current)
 SendStateDataSampleListConstIterator (const SendStateDataSampleListIterator &iterator)
SendStateDataSampleListConstIteratoroperator++ ()
SendStateDataSampleListConstIterator operator++ (int)
SendStateDataSampleListConstIteratoroperator-- ()
SendStateDataSampleListConstIterator operator-- (int)
reference operator * () const
pointer operator-> () const
bool operator== (const SendStateDataSampleListConstIterator &rhs) const
bool operator!= (const SendStateDataSampleListConstIterator &rhs) const

Private Member Functions

 SendStateDataSampleListConstIterator ()

Private Attributes

const DataSampleElementhead_
const DataSampleElementtail_
const DataSampleElementcurrent_

Detailed Description

SendStateDataSampleList STL-style const iterator implementation.

This class implements a STL-style const iterator for the OpenDDS SendStateDataSampleList class. The resulting iterator may be used with the STL generic algorithms. It is meant for iteration over the "send samples" in a SendStateDataSampleList.

Definition at line 92 of file SendStateDataSampleList.h.


Member Typedef Documentation

typedef const DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListConstIterator::pointer

Definition at line 95 of file SendStateDataSampleList.h.

typedef const DataSampleElement& OpenDDS::DCPS::SendStateDataSampleListConstIterator::reference

Definition at line 96 of file SendStateDataSampleList.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::SendStateDataSampleListConstIterator::SendStateDataSampleListConstIterator ( const DataSampleElement head,
const DataSampleElement tail,
const DataSampleElement current 
)

Definition at line 189 of file SendStateDataSampleList.cpp.

00193   : head_(head)
00194   , tail_(tail)
00195   , current_(current)
00196 {
00197 }

OpenDDS::DCPS::SendStateDataSampleListConstIterator::SendStateDataSampleListConstIterator ( const SendStateDataSampleListIterator iterator  ) 

Definition at line 199 of file SendStateDataSampleList.cpp.

00201   : head_(iterator.head_)
00202   , tail_(iterator.tail_)
00203   , current_(iterator.current_)
00204 {
00205 }

OpenDDS::DCPS::SendStateDataSampleListConstIterator::SendStateDataSampleListConstIterator (  )  [private]


Member Function Documentation

SendStateDataSampleListConstIterator::reference OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator * (  )  const

Definition at line 245 of file SendStateDataSampleList.cpp.

References current_.

00246 {
00247   // Hopefully folks will be smart enough to not dereference a
00248   // null iterator.  Such a case should only exist for an "end"
00249   // iterator.  Otherwise we may want to throw an exception here.
00250   // assert (this->current_ != 0);
00251 
00252   return *(this->current_);
00253 }

bool OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator!= ( const SendStateDataSampleListConstIterator rhs  )  const [inline]

Definition at line 120 of file SendStateDataSampleList.h.

00120                                                                     {
00121     return !(*this == rhs);
00122   }

SendStateDataSampleListConstIterator OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator++ ( int   ) 

Definition at line 217 of file SendStateDataSampleList.cpp.

00218 {
00219   SendStateDataSampleListConstIterator tmp(*this);
00220   ++(*this);
00221   return tmp;
00222 }

SendStateDataSampleListConstIterator & OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator++ (  ) 

Definition at line 208 of file SendStateDataSampleList.cpp.

References current_, and OpenDDS::DCPS::DataSampleElement::next_send_sample_.

00209 {
00210   if (this->current_)
00211     this->current_ = this->current_->next_send_sample_;
00212 
00213   return *this;
00214 }

SendStateDataSampleListConstIterator OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator-- ( int   ) 

Definition at line 237 of file SendStateDataSampleList.cpp.

00238 {
00239   SendStateDataSampleListConstIterator tmp(*this);
00240   --(*this);
00241   return tmp;
00242 }

SendStateDataSampleListConstIterator & OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator-- (  ) 

Definition at line 225 of file SendStateDataSampleList.cpp.

References current_, OpenDDS::DCPS::DataSampleElement::previous_send_sample_, and tail_.

00226 {
00227   if (this->current_)
00228     this->current_ = this->current_->previous_send_sample_;
00229 
00230   else
00231     this->current_ = this->tail_;
00232 
00233   return *this;
00234 }

SendStateDataSampleListConstIterator::pointer OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator-> (  )  const

Definition at line 256 of file SendStateDataSampleList.cpp.

References current_.

00257 {
00258   return this->current_;
00259 }

bool OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator== ( const SendStateDataSampleListConstIterator rhs  )  const [inline]

Definition at line 113 of file SendStateDataSampleList.h.

References current_, head_, and tail_.

00113                                                                     {
00114     return this->head_ == rhs.head_
00115            && this->tail_ == rhs.tail_
00116            && this->current_ == rhs.current_;
00117   }


Member Data Documentation

const DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListConstIterator::current_ [private]

Definition at line 129 of file SendStateDataSampleList.h.

Referenced by operator *(), operator++(), operator--(), operator->(), and operator==().

const DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListConstIterator::head_ [private]

Definition at line 127 of file SendStateDataSampleList.h.

Referenced by operator==().

const DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListConstIterator::tail_ [private]

Definition at line 128 of file SendStateDataSampleList.h.

Referenced by operator--(), and operator==().


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