OpenDDS::DCPS::SendStateDataSampleListIterator Struct Reference

SendStateDataSampleList STL-style iterator implementation. More...

#include <SendStateDataSampleList.h>

Collaboration diagram for OpenDDS::DCPS::SendStateDataSampleListIterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SendStateDataSampleListIterator (DataSampleElement *head, DataSampleElement *tail, DataSampleElement *current)
 Default constructor.
SendStateDataSampleListIteratoroperator++ ()
SendStateDataSampleListIterator operator++ (int)
SendStateDataSampleListIteratoroperator-- ()
SendStateDataSampleListIterator operator-- (int)
reference operator * ()
pointer operator-> ()
bool operator== (const SendStateDataSampleListIterator &rhs) const
bool operator!= (const SendStateDataSampleListIterator &rhs) const

Private Member Functions

 SendStateDataSampleListIterator ()

Private Attributes

DataSampleElementhead_
DataSampleElementtail_
DataSampleElementcurrent_

Friends

class SendStateDataSampleListConstIterator

Detailed Description

SendStateDataSampleList STL-style iterator implementation.

This class implements a STL-style 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 38 of file SendStateDataSampleList.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::SendStateDataSampleListIterator::SendStateDataSampleListIterator ( DataSampleElement head,
DataSampleElement tail,
DataSampleElement current 
)

Default constructor.

This constructor is used when constructing an "end" iterator.

Definition at line 125 of file SendStateDataSampleList.cpp.

00129   : head_(head)
00130   , tail_(tail)
00131   , current_(current)
00132 {
00133 }

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


Member Function Documentation

SendStateDataSampleListIterator::reference OpenDDS::DCPS::SendStateDataSampleListIterator::operator * (  ) 

Definition at line 173 of file SendStateDataSampleList.cpp.

References current_.

00174 {
00175   // Hopefully folks will be smart enough to not dereference a
00176   // null iterator.  Such a case should only exist for an "end"
00177   // iterator.  Otherwise we may want to throw an exception here.
00178   // assert (this->current_ != 0);
00179 
00180   return *(this->current_);
00181 }

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

Definition at line 68 of file SendStateDataSampleList.h.

00068                                                                {
00069     return !(*this == rhs);
00070   }

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

Definition at line 145 of file SendStateDataSampleList.cpp.

00146 {
00147   SendStateDataSampleListIterator tmp(*this);
00148   ++(*this);
00149   return tmp;
00150 }

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

Definition at line 136 of file SendStateDataSampleList.cpp.

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

00137 {
00138   if (this->current_)
00139     this->current_ = this->current_->next_send_sample_;
00140 
00141   return *this;
00142 }

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

Definition at line 165 of file SendStateDataSampleList.cpp.

00166 {
00167   SendStateDataSampleListIterator tmp(*this);
00168   --(*this);
00169   return tmp;
00170 }

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

Definition at line 153 of file SendStateDataSampleList.cpp.

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

00154 {
00155   if (this->current_)
00156     this->current_ = this->current_->previous_send_sample_;
00157 
00158   else
00159     this->current_ = this->tail_;
00160 
00161   return *this;
00162 }

SendStateDataSampleListIterator::pointer OpenDDS::DCPS::SendStateDataSampleListIterator::operator-> (  ) 

Definition at line 184 of file SendStateDataSampleList.cpp.

References current_.

00185 {
00186   return this->current_;
00187 }

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

Definition at line 61 of file SendStateDataSampleList.h.

References current_, head_, and tail_.

00061                                                                {
00062     return this->head_ == rhs.head_
00063            && this->tail_ == rhs.tail_
00064            && this->current_ == rhs.current_;
00065   }


Friends And Related Function Documentation

friend class SendStateDataSampleListConstIterator [friend]

Definition at line 79 of file SendStateDataSampleList.h.


Member Data Documentation

DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListIterator::current_ [private]

Definition at line 77 of file SendStateDataSampleList.h.

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

DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListIterator::head_ [private]

Definition at line 75 of file SendStateDataSampleList.h.

Referenced by operator==().

DataSampleElement* OpenDDS::DCPS::SendStateDataSampleListIterator::tail_ [private]

Definition at line 76 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