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 ()
 Default constructor required by ForwardIterator concept.
 SendStateDataSampleListIterator (DataSampleElement *head, DataSampleElement *tail, DataSampleElement *current)
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 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 41 of file SendStateDataSampleList.h.


Constructor & Destructor Documentation

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

Default constructor required by ForwardIterator concept.

Definition at line 47 of file SendStateDataSampleList.h.

00047 {}

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

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 }


Member Function Documentation

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

Definition at line 72 of file SendStateDataSampleList.h.

00072                                                                {
00073     return !(*this == rhs);
00074   }

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

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 }

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

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

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

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 65 of file SendStateDataSampleList.h.

References current_, head_, and tail_.

00065                                                                {
00066     return this->head_ == rhs.head_
00067            && this->tail_ == rhs.tail_
00068            && this->current_ == rhs.current_;
00069   }


Friends And Related Function Documentation

friend class SendStateDataSampleListConstIterator [friend]

Definition at line 81 of file SendStateDataSampleList.h.


Member Data Documentation

Definition at line 79 of file SendStateDataSampleList.h.

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

Definition at line 77 of file SendStateDataSampleList.h.

Referenced by operator==().

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