![]() |
Dynamic cast iterator for polymorphic pointer vectors.The ConstCastIterator class is part of the PtrVector class and represent a forward iterator over all elements of type C contained in a range of elements of type T, where C is a type derived from T. The ConstCastIterator is the counterpart of CastIterator for constant vectors. More...
#include <PtrVector.h>
Public Types | |
typedef std::forward_iterator_tag | IteratorCategory |
The iterator category. | |
typedef const C * | ValueType |
Type of the underlying pointers. | |
typedef const C * | PointerType |
Pointer return type. | |
typedef const C *const & | ReferenceType |
Reference return type. | |
typedef ptrdiff_t | DifferenceType |
Difference between two iterators. | |
typedef const T *const * | IteratorType |
Type of the internal pointer. | |
typedef IteratorCategory | iterator_category |
The iterator category. | |
typedef ValueType | value_type |
Type of the underlying pointers. | |
typedef PointerType | pointer |
Pointer return type. | |
typedef ReferenceType | reference |
Reference return type. | |
typedef DifferenceType | difference_type |
Difference between two iterators. | |
Public Member Functions | |
Constructors | |
ConstCastIterator () | |
Default constructor for ConstCastIterator. | |
ConstCastIterator (IteratorType begin, IteratorType end) | |
Standard constructor for ConstCastIterator. | |
template<typename Other > | |
ConstCastIterator (const ConstCastIterator< Other > &it) | |
Conversion constructor from different ConstCastIterator instances. | |
template<typename Other > | |
ConstCastIterator (const typename PtrVector< T, D, G >::BLAZE_TEMPLATE CastIterator< Other > &it) | |
Conversion constructor from CastIterator instances. | |
Operators | |
ConstCastIterator & | operator++ () |
Pre-increment operator. | |
ConstCastIterator | operator++ (int) |
Post-increment operator. | |
Access operators | |
PointerType | operator* () const |
Returns a handle to the element at the current iterator position. | |
PointerType | operator-> () const |
Direct access to the element at the current iterator position. | |
Utility functions | |
const IteratorType & | base () const |
Direct access to the current memory location of the constant cast iterator. | |
const IteratorType & | stop () const |
Direct access to the final memory location of the constant cast iterator. | |
Private Attributes | |
Member variables | |
IteratorType | cur_ |
Pointer to the current memory location. | |
IteratorType | end_ |
Pointer to the element one past the last element in the element range. | |
Dynamic cast iterator for polymorphic pointer vectors.
The ConstCastIterator class is part of the PtrVector class and represent a forward iterator over all elements of type C contained in a range of elements of type T, where C is a type derived from T. The ConstCastIterator is the counterpart of CastIterator for constant vectors.
Note: Using a ConstCastIterator is computationally more expensive than using a standard iterator over all elements contained in the vector.
|
inline |
Standard constructor for ConstCastIterator.
begin | The beginning of the element range. |
end | The end of the element range. |
|
inline |
Conversion constructor from different ConstCastIterator instances.
it | The foreign ConstCastIterator instance to be copied. |
|
inline |
Conversion constructor from CastIterator instances.
it | The foreign CastIterator instance to be copied. |
|
inline |
Direct access to the current memory location of the constant cast iterator.
|
inline |
Returns a handle to the element at the current iterator position.
|
inline |
Pre-increment operator.
|
inline |
Post-increment operator.
|
inline |
Direct access to the element at the current iterator position.
|
inline |
Direct access to the final memory location of the constant cast iterator.