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 ()
 Default constructor required by ForwardIterator concept.
 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 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 94 of file SendStateDataSampleList.h.


Member Typedef Documentation

Definition at line 98 of file SendStateDataSampleList.h.

Definition at line 99 of file SendStateDataSampleList.h.


Constructor & Destructor Documentation

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

Default constructor required by ForwardIterator concept.

Definition at line 102 of file SendStateDataSampleList.h.

00102 {}

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 }


Member Function Documentation

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

Definition at line 125 of file SendStateDataSampleList.h.

00125                                                                     {
00126     return !(*this == rhs);
00127   }

SendStateDataSampleListConstIterator::reference OpenDDS::DCPS::SendStateDataSampleListConstIterator::operator* ( void   )  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 }

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++ ( void   ) 

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-- ( void   ) 

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-> ( void   )  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 118 of file SendStateDataSampleList.h.

References current_, head_, and tail_.

00118                                                                     {
00119     return this->head_ == rhs.head_
00120            && this->tail_ == rhs.tail_
00121            && this->current_ == rhs.current_;
00122   }


Member Data Documentation

Definition at line 132 of file SendStateDataSampleList.h.

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

Definition at line 130 of file SendStateDataSampleList.h.

Referenced by operator==().

Definition at line 131 of file SendStateDataSampleList.h.

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


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1