SendStateDataSampleList
STL-style const iterator implementation.
More...
#include <SendStateDataSampleList.h>
Collaboration diagram for OpenDDS::DCPS::SendStateDataSampleListConstIterator:
Public Types | |
typedef const DataSampleElement * | pointer |
typedef const DataSampleElement & | reference |
Public Member Functions | |
SendStateDataSampleListConstIterator (const DataSampleElement *head, const DataSampleElement *tail, const DataSampleElement *current) | |
SendStateDataSampleListConstIterator (const SendStateDataSampleListIterator &iterator) | |
SendStateDataSampleListConstIterator & | operator++ () |
SendStateDataSampleListConstIterator | operator++ (int) |
SendStateDataSampleListConstIterator & | operator-- () |
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 DataSampleElement * | head_ |
const DataSampleElement * | tail_ |
const DataSampleElement * | current_ |
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.
Definition at line 95 of file SendStateDataSampleList.h.
Definition at line 96 of file SendStateDataSampleList.h.
OpenDDS::DCPS::SendStateDataSampleListConstIterator::SendStateDataSampleListConstIterator | ( | const DataSampleElement * | head, | |
const DataSampleElement * | tail, | |||
const DataSampleElement * | current | |||
) |
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] |
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] |
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 129 of file SendStateDataSampleList.h.
Referenced by operator *(), operator++(), operator--(), operator->(), and operator==().
Definition at line 128 of file SendStateDataSampleList.h.
Referenced by operator--(), and operator==().