NEST main@f146f75
Loading...
Searching...
No Matches
bv_iterator< value_type_, ref_, ptr_ > Class Template Reference

A BlockVector::iterator. More...

#include <block_vector.h>

Inheritance diagram for bv_iterator< value_type_, ref_, ptr_ >:
[legend]
Collaboration diagram for bv_iterator< value_type_, ref_, ptr_ >:
[legend]

Public Types

using iterator = iter_< value_type_ >
using const_iterator = iter_< const value_type_ >
using iterator_category = std::random_access_iterator_tag
using value_type = value_type_
using pointer = ptr_
using reference = ref_
using difference_type = typename BlockVector< value_type >::difference_type

Public Member Functions

 bv_iterator ()
 bv_iterator (const BlockVector< value_type_ > &)
 Creates an iterator pointing to the first element in a BlockVector.
 bv_iterator (const iterator &)
 Iterator copy constructor.
 bv_iterator (const BlockVector< value_type_ > *, const typename std::vector< std::vector< value_type_ > >::const_iterator, const typename std::vector< value_type_ >::const_iterator, const typename std::vector< value_type_ >::const_iterator)
 Creates an iterator with specified parameters.
bv_iterator & operator++ ()
bv_iterator & operator-- ()
bv_iterator & operator+= (difference_type)
bv_iterator & operator-= (difference_type)
bv_iterator operator+ (difference_type) const
bv_iterator operator- (difference_type) const
bv_iterator operator++ (int)
bv_iterator operator-- (int)
reference operator* () const
pointer operator-> () const
difference_type operator- (const iterator &) const
difference_type operator- (const const_iterator &) const
iterator & operator= (const iterator &)
reference operator[] (difference_type n) const
bool operator== (const bv_iterator &) const
bool operator!= (const bv_iterator &) const
bool operator< (const bv_iterator &) const
bool operator> (const bv_iterator &) const
bool operator<= (const bv_iterator &) const
bool operator>= (const bv_iterator &) const

Private Types

template<typename cv_value_type_>
using iter_ = bv_iterator< value_type_, cv_value_type_&, cv_value_type_* >

Private Member Functions

iterator const_cast_ () const
 Converts the iterator to a non-const iterator.

Private Attributes

const BlockVector< value_type_ > * block_vector_
 BlockVector to which this iterator points.
std::vector< std::vector< value_type_ > >::const_iterator block_vector_it_
 Iterator for the current block in the blockmap.
std::vector< value_type_ >::const_iterator block_it_
 Iterator pointing to the current element in the current block.
std::vector< value_type_ >::const_iterator current_block_end_
 Iterator pointing to the end of the current block.

Friends

class BlockVector< value_type_ >
template<typename, typename, typename>
class bv_iterator

Detailed Description

template<typename value_type_, typename ref_, typename ptr_>
class bv_iterator< value_type_, ref_, ptr_ >

A BlockVector::iterator.

Template Parameters
value_type_Type of element.
ref_Type of reference to the element.
ptr_Type of pointer to the element.

BlockVector holds one of this internally, marking the end of the valid range.

Member Typedef Documentation

◆ const_iterator

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::const_iterator = iter_< const value_type_ >

◆ difference_type

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::difference_type = typename BlockVector< value_type >::difference_type

◆ iter_

template<typename value_type_, typename ref_, typename ptr_>
template<typename cv_value_type_>
using bv_iterator< value_type_, ref_, ptr_ >::iter_ = bv_iterator< value_type_, cv_value_type_&, cv_value_type_* >
private

◆ iterator

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::iterator = iter_< value_type_ >

◆ iterator_category

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::iterator_category = std::random_access_iterator_tag

◆ pointer

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::pointer = ptr_

◆ reference

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::reference = ref_

◆ value_type

template<typename value_type_, typename ref_, typename ptr_>
using bv_iterator< value_type_, ref_, ptr_ >::value_type = value_type_

Constructor & Destructor Documentation

◆ bv_iterator() [1/4]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::bv_iterator ( )
inline

◆ bv_iterator() [2/4]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::bv_iterator ( const BlockVector< value_type_ > & block_vector)
inlineexplicit

Creates an iterator pointing to the first element in a BlockVector.

Parameters
block_vectorBlockVector to which the iterator will point to.

References block_it_, block_vector_, block_vector_it_, BlockVector< value_type_ >, and current_block_end_.

Here is the call graph for this function:

◆ bv_iterator() [3/4]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::bv_iterator ( const iterator & other)
inline

Iterator copy constructor.

Parameters
otherIterator to be copied.

References block_it_, block_vector_, block_vector_it_, and current_block_end_.

◆ bv_iterator() [4/4]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::bv_iterator ( const BlockVector< value_type_ > * block_vector,
const typename std::vector< std::vector< value_type_ > >::const_iterator block_vector_it,
const typename std::vector< value_type_ >::const_iterator block_it,
const typename std::vector< value_type_ >::const_iterator current_block_end )
inline

Creates an iterator with specified parameters.

Parameters
block_vectorBlockVector to point to.
block_indexIndex of current block.
block_itIterator pointing to current element in the current block.
current_block_endIterator pointing to the end of the current block.

References block_it_, block_vector_, block_vector_it_, BlockVector< value_type_ >, and current_block_end_.

Here is the call graph for this function:

Member Function Documentation

◆ const_cast_()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::iterator bv_iterator< value_type_, ref_, ptr_ >::const_cast_ ( ) const
inlineprivate

Converts the iterator to a non-const iterator.

References block_it_, block_vector_, block_vector_it_, and current_block_end_.

Referenced by BlockVector< value_type_ >::erase().

Here is the caller graph for this function:

◆ operator!=()

template<typename value_type_, typename ref_, typename ptr_>
bool bv_iterator< value_type_, ref_, ptr_ >::operator!= ( const bv_iterator< value_type_, ref_, ptr_ > & rhs) const
inline

References block_it_, block_vector_it_, and bv_iterator.

Here is the call graph for this function:

◆ operator*()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::reference bv_iterator< value_type_, ref_, ptr_ >::operator* ( ) const
inline

◆ operator+()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > bv_iterator< value_type_, ref_, ptr_ >::operator+ ( difference_type val) const
inline

References bv_iterator.

Here is the call graph for this function:

◆ operator++() [1/2]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > & bv_iterator< value_type_, ref_, ptr_ >::operator++ ( )
inline

References block_it_, block_vector_, block_vector_it_, and current_block_end_.

Referenced by operator+=().

Here is the caller graph for this function:

◆ operator++() [2/2]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > bv_iterator< value_type_, ref_, ptr_ >::operator++ ( int )
inline

References bv_iterator.

Here is the call graph for this function:

◆ operator+=()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > & bv_iterator< value_type_, ref_, ptr_ >::operator+= ( difference_type val)
inline

References operator++(), and operator-=().

Referenced by operator-=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator-() [1/3]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::difference_type bv_iterator< value_type_, ref_, ptr_ >::operator- ( const const_iterator & other) const
inline

◆ operator-() [2/3]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::difference_type bv_iterator< value_type_, ref_, ptr_ >::operator- ( const iterator & other) const
inline

◆ operator-() [3/3]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > bv_iterator< value_type_, ref_, ptr_ >::operator- ( difference_type val) const
inline

References bv_iterator.

Here is the call graph for this function:

◆ operator--() [1/2]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > & bv_iterator< value_type_, ref_, ptr_ >::operator-- ( )
inline

References block_it_, block_vector_, block_vector_it_, and current_block_end_.

Referenced by operator-=().

Here is the caller graph for this function:

◆ operator--() [2/2]

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > bv_iterator< value_type_, ref_, ptr_ >::operator-- ( int )
inline

References bv_iterator.

Here is the call graph for this function:

◆ operator-=()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ > & bv_iterator< value_type_, ref_, ptr_ >::operator-= ( difference_type val)
inline

References operator+=(), and operator--().

Referenced by operator+=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator->()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::pointer bv_iterator< value_type_, ref_, ptr_ >::operator-> ( ) const
inline

◆ operator<()

template<typename value_type_, typename ref_, typename ptr_>
bool bv_iterator< value_type_, ref_, ptr_ >::operator< ( const bv_iterator< value_type_, ref_, ptr_ > & rhs) const
inline

References block_it_, block_vector_it_, and bv_iterator.

Referenced by operator<=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<=()

template<typename value_type_, typename ref_, typename ptr_>
bool bv_iterator< value_type_, ref_, ptr_ >::operator<= ( const bv_iterator< value_type_, ref_, ptr_ > & rhs) const
inline

References bv_iterator, operator<(), and operator==().

Here is the call graph for this function:

◆ operator=()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::iterator & bv_iterator< value_type_, ref_, ptr_ >::operator= ( const iterator & other)
inline

◆ operator==()

template<typename value_type_, typename ref_, typename ptr_>
bool bv_iterator< value_type_, ref_, ptr_ >::operator== ( const bv_iterator< value_type_, ref_, ptr_ > & rhs) const
inline

References block_it_, block_vector_it_, and bv_iterator.

Referenced by operator<=(), and operator>=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator>()

template<typename value_type_, typename ref_, typename ptr_>
bool bv_iterator< value_type_, ref_, ptr_ >::operator> ( const bv_iterator< value_type_, ref_, ptr_ > & rhs) const
inline

References block_it_, block_vector_it_, and bv_iterator.

Referenced by operator>=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator>=()

template<typename value_type_, typename ref_, typename ptr_>
bool bv_iterator< value_type_, ref_, ptr_ >::operator>= ( const bv_iterator< value_type_, ref_, ptr_ > & rhs) const
inline

References bv_iterator, operator==(), and operator>().

Here is the call graph for this function:

◆ operator[]()

template<typename value_type_, typename ref_, typename ptr_>
bv_iterator< value_type_, ref_, ptr_ >::reference bv_iterator< value_type_, ref_, ptr_ >::operator[] ( difference_type n) const
inline

◆ BlockVector< value_type_ >

template<typename value_type_, typename ref_, typename ptr_>
friend class BlockVector< value_type_ >
friend

Referenced by bv_iterator(), and bv_iterator().

◆ bv_iterator

template<typename value_type_, typename ref_, typename ptr_>
template<typename, typename, typename>
friend class bv_iterator
friend

Member Data Documentation

◆ block_it_

template<typename value_type_, typename ref_, typename ptr_>
std::vector<value_type_>::const_iterator bv_iterator< value_type_, ref_, ptr_ >::block_it_
private

Iterator pointing to the current element in the current block.

Referenced by bv_iterator(), bv_iterator(), bv_iterator(), const_cast_(), operator!=(), operator++(), operator-(), operator-(), operator--(), operator<(), operator=(), operator==(), and operator>().

◆ block_vector_

template<typename value_type_, typename ref_, typename ptr_>
const BlockVector< value_type_ >* bv_iterator< value_type_, ref_, ptr_ >::block_vector_
private

◆ block_vector_it_

template<typename value_type_, typename ref_, typename ptr_>
std::vector<std::vector<value_type_>>::const_iterator bv_iterator< value_type_, ref_, ptr_ >::block_vector_it_
private

◆ current_block_end_

template<typename value_type_, typename ref_, typename ptr_>
std::vector<value_type_>::const_iterator bv_iterator< value_type_, ref_, ptr_ >::current_block_end_
private

Iterator pointing to the end of the current block.

Referenced by bv_iterator(), bv_iterator(), bv_iterator(), const_cast_(), operator++(), operator--(), and operator=().


The documentation for this class was generated from the following file: