Dynamic cast iterator for polymorphic pointer vectors.
The RigidBodyCastIterator is a forward iterator which only selects elements of type C. Dereferencing this iterator will implicitly cast to C.
#include <RigidBodyCastIterator.h>
Public Types | |
using | ContainerType = std::vector< std::unique_ptr< RigidBody > > |
using | iterator_category = std::forward_iterator_tag |
using | value_type = C |
using | pointer = C * |
using | reference = C & |
using | difference_type = std::ptrdiff_t |
Public Member Functions | |
Constructors | |
RigidBodyCastIterator ()=default | |
RigidBodyCastIterator (const typename ContainerType::iterator &begin, const typename ContainerType::iterator &end) | |
Standard constructor for CastIterator. More... | |
RigidBodyCastIterator (const RigidBodyCastIterator< C > &it)=default | |
RigidBodyCastIterator (RigidBodyCastIterator< C > &&it)=default | |
RigidBodyCastIterator & | operator= (const RigidBodyCastIterator< C > &it)=default |
RigidBodyCastIterator & | operator= (RigidBodyCastIterator< C > &&it)=default |
Operators | |
RigidBodyCastIterator< C > & | operator++ () |
Pre-increment operator. More... | |
RigidBodyCastIterator< C > | operator++ (int) |
Access operators | |
reference | operator* () |
pointer | operator-> () |
Utility functions | |
pointer | getBodyID () |
Private Attributes | |
Member variables | |
ContainerType::iterator | cur_ |
Pointer to the current memory location. More... | |
ContainerType::iterator | end_ |
Pointer to the element one past the last element in the element range. More... | |
Friends | |
template<typename C2 > | |
bool | operator== (const RigidBodyCastIterator< C2 > &lhs, const RigidBodyCastIterator< C2 > &rhs) |
template<typename C2 > | |
bool | operator!= (const RigidBodyCastIterator< C2 > &lhs, const RigidBodyCastIterator< C2 > &rhs) |
using walberla::pe::RigidBodyCastIterator< C >::ContainerType = std::vector< std::unique_ptr<RigidBody> > |
using walberla::pe::RigidBodyCastIterator< C >::difference_type = std::ptrdiff_t |
using walberla::pe::RigidBodyCastIterator< C >::iterator_category = std::forward_iterator_tag |
using walberla::pe::RigidBodyCastIterator< C >::pointer = C* |
using walberla::pe::RigidBodyCastIterator< C >::reference = C& |
using walberla::pe::RigidBodyCastIterator< C >::value_type = C |
|
inlinedefault |
|
inlineexplicit |
Standard constructor for CastIterator.
begin | The beginning of the element range. |
end | The end of the element range. |
|
default |
|
default |
|
inline |
|
inline |
|
inline |
Pre-increment operator.
|
inline |
|
inline |
|
default |
|
default |
|
friend |
|
friend |
|
private |
Pointer to the current memory location.
|
private |
Pointer to the element one past the last element in the element range.