SendStateDataSampleList
STL-style iterator implementation.
More...
#include <SendStateDataSampleList.h>
Collaboration diagram for OpenDDS::DCPS::SendStateDataSampleListIterator:
Public Member Functions | |
SendStateDataSampleListIterator (DataSampleElement *head, DataSampleElement *tail, DataSampleElement *current) | |
Default constructor. | |
SendStateDataSampleListIterator & | operator++ () |
SendStateDataSampleListIterator | operator++ (int) |
SendStateDataSampleListIterator & | operator-- () |
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 | |
DataSampleElement * | head_ |
DataSampleElement * | tail_ |
DataSampleElement * | current_ |
Friends | |
class | SendStateDataSampleListConstIterator |
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.
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.
OpenDDS::DCPS::SendStateDataSampleListIterator::SendStateDataSampleListIterator | ( | ) | [private] |
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] |
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] |
friend class SendStateDataSampleListConstIterator [friend] |
Definition at line 79 of file SendStateDataSampleList.h.
Definition at line 77 of file SendStateDataSampleList.h.
Referenced by operator *(), operator++(), operator--(), operator->(), and operator==().
Definition at line 76 of file SendStateDataSampleList.h.
Referenced by operator--(), and operator==().