Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t > Class Template Reference

Iterator for the class PiercedStorage. More...

#include <piercedStorageIterator.hpp>

Inheritance diagram for bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >:
Inheritance graph
[legend]
Collaboration diagram for bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >:
Collaboration graph
[legend]

Public Types

typedef std::ptrdiff_t difference_type
 
typedef id_t id_type
 
typedef std::bidirectional_iterator_tag iterator_category
 
typedef std::conditional< std::is_const< value_t >::value, typenameStorage< value_no_cv_t, id_t >::const_pointer, typenameStorage< value_no_cv_t, id_t >::pointer >::type pointer
 
typedef std::conditional< std::is_const< value_t >::value, typenameStorage< value_no_cv_t, id_t >::const_reference, typenameStorage< value_no_cv_t, id_t >::reference >::type reference
 
typedef storage_t storage_type
 
typedef value_t value_type
 

Public Member Functions

 PiercedStorageIterator ()
 
template<typename other_value_t , typename std::enable_if< std::is_const< value_t >::value &&!std::is_const< other_value_t >::value &&std::is_same< other_value_t, typename std::remove_cv< value_t >::type >::value, int >::type = 0>
 PiercedStorageIterator (const PiercedStorageIterator< other_value_t, id_t, value_no_cv_t > &other)
 
const PiercedKernelIterator< id_t > & getKernelIterator () const
 
storage_typegetStorage () const
 
__PSI_REFERENCE__ getValue (std::size_t k=0) const
 
bool operator!= (const PiercedStorageIterator &rhs) const
 
__PSI_REFERENCE__ operator* () const
 
PiercedStorageIteratoroperator++ ()
 
PiercedStorageIterator operator++ (int)
 
PiercedStorageIteratoroperator-- ()
 
PiercedStorageIterator operator-- (int)
 
__PSI_POINTER__ operator-> () const
 
template<typename other_value_t , typename std::enable_if< std::is_const< value_t >::value &&!std::is_const< other_value_t >::value &&std::is_same< other_value_t, typename std::remove_cv< value_t >::type >::value, int >::type = 0>
PiercedStorageIteratoroperator= (const PiercedStorageIterator< other_value_t, id_t, value_no_cv_t > &other)
 
template<typename other_value_t , typename std::enable_if< std::is_const< value_t >::value &&!std::is_const< other_value_t >::value &&std::is_same< other_value_t, typename std::remove_cv< value_t >::type >::value, int >::type >
PiercedStorageIterator< value_t, id_t, value_no_cv_t > & operator= (const PiercedStorageIterator< other_value_t, id_t, value_no_cv_t > &other)
 
bool operator== (const PiercedStorageIterator &rhs) const
 
void swap (PiercedStorageIterator &other) noexcept
 

Friends

template<typename PS_value_t , typename PS_id_t >
class PiercedStorage
 
class PiercedStorageIterator< typename std::add_const< value_t >::type, id_t, value_no_cv_t >
 

Additional Inherited Members

- Protected Types inherited from bitpit::PiercedKernelIterator< id_t >
typedef std::ptrdiff_t difference_type
 
typedef id_t id_type
 
typedef std::bidirectional_iterator_tag iterator_category
 
typedef kernel_t kernel_type
 
typedef const id_t * pointer
 
typedef const id_t & reference
 
typedef id_t value_type
 
- Protected Member Functions inherited from bitpit::PiercedKernelIterator< id_t >
 PiercedKernelIterator ()
 
id_t getId (const id_t &fallback=-1) const noexcept
 
const kernel_typegetKernel () const
 
std::size_t getPos () const noexcept
 
std::size_t getRawIndex () const noexcept
 
bool operator!= (const PiercedKernelIterator &rhs) const
 
const id_t & operator* () const
 
PiercedKernelIteratoroperator++ ()
 
PiercedKernelIterator operator++ (int)
 
PiercedKernelIteratoroperator-- ()
 
PiercedKernelIterator operator-- (int)
 
const id_t * operator-> () const
 
bool operator== (const PiercedKernelIterator &rhs) const
 
void swap (PiercedKernelIterator &other) noexcept
 

Detailed Description

template<typename value_t, typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
class bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >

Iterator for the class PiercedStorage.

Template Parameters
value_tis the type of elements in the storage
id_tis the type of ids associated to the elements

Definition at line 51 of file piercedStorageIterator.hpp.

Member Typedef Documentation

◆ difference_type

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef std::ptrdiff_t bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::difference_type

Difference type

Definition at line 100 of file piercedStorageIterator.hpp.

◆ id_type

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef id_t bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::id_type

Id type

Definition at line 85 of file piercedStorageIterator.hpp.

◆ iterator_category

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef std::bidirectional_iterator_tag bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::iterator_category

Iterator category

Definition at line 90 of file piercedStorageIterator.hpp.

◆ pointer

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef std::conditional<std::is_const<value_t>::value,typenameStorage<value_no_cv_t,id_t>::const_pointer,typenameStorage<value_no_cv_t,id_t>::pointer>::type bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::pointer

Pointer type

Definition at line 111 of file piercedStorageIterator.hpp.

◆ reference

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef std::conditional<std::is_const<value_t>::value,typenameStorage<value_no_cv_t,id_t>::const_reference,typenameStorage<value_no_cv_t,id_t>::reference>::type bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::reference

Reference type

Definition at line 122 of file piercedStorageIterator.hpp.

◆ storage_type

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef storage_t bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::storage_type

Constant container

Definition at line 127 of file piercedStorageIterator.hpp.

◆ value_type

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
typedef value_t bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::value_type

Value type

Definition at line 95 of file piercedStorageIterator.hpp.

Constructor & Destructor Documentation

◆ PiercedStorageIterator() [1/2]

template<typename value_t , typename id_t , typename value_no_cv_t >
bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::PiercedStorageIterator ( )

Creates a new uninitialized iterator

Definition at line 34 of file piercedStorageIterator.tpp.

◆ PiercedStorageIterator() [2/2]

template<typename value_t , typename id_t , typename value_no_cv_t >
template<typename other_value_t , typename std::enable_if< std::is_const< value_t >::value &&!std::is_const< other_value_t >::value &&std::is_same< other_value_t, typename std::remove_cv< value_t >::type >::value, int >::type >
bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::PiercedStorageIterator ( const PiercedStorageIterator< other_value_t, id_t, value_no_cv_t > & other)

Creates a new constant iterator pointing to the same position of the specified iterator.

Parameters
otheris the iterator that will be copied

Definition at line 47 of file piercedStorageIterator.tpp.

Member Function Documentation

◆ getKernelIterator()

template<typename value_t , typename id_t , typename value_no_cv_t >
const PiercedKernelIterator< id_t > & bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::getKernelIterator ( ) const

Get a constant reference to the kernel iterator.

Returns
A constant reference to the kernel iterator.

Definition at line 104 of file piercedStorageIterator.tpp.

◆ getStorage()

template<typename value_t , typename id_t , typename value_no_cv_t >
PiercedStorageIterator< value_t, id_t, value_no_cv_t >::storage_type & bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::getStorage ( ) const

Get a constant reference of the storage associated with the iterator.

Returns
A constant reference of the storage associated with the iterator.

Definition at line 93 of file piercedStorageIterator.tpp.

◆ getValue()

template<typename value_t , typename id_t , typename value_no_cv_t >
__PSI_REFERENCE__ bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::getValue ( std::size_t k = 0) const

Gets the values of the current element.

Parameters
kis the index of the requested field
Returns
The values of the current element.

Definition at line 116 of file piercedStorageIterator.tpp.

◆ operator!=()

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
bool bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator!= ( const PiercedStorageIterator< value_t, id_t, value_no_cv_t > & rhs) const
inline

Two-way comparison.

Definition at line 172 of file piercedStorageIterator.hpp.

◆ operator*()

template<typename value_t , typename id_t , typename value_no_cv_t >
__PSI_REFERENCE__ bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator* ( ) const

Deference operator.

Returns
A reference to the element currently pointed to by the iterator.

Definition at line 199 of file piercedStorageIterator.tpp.

◆ operator++() [1/2]

template<typename value_t , typename id_t , typename value_no_cv_t >
PiercedStorageIterator< value_t, id_t, value_no_cv_t > & bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator++ ( )

Pre-increment operator.

Increment operator does not check whether it crosses the end() of the container. Thus, calling this function if the iterator is already at the end of the container results in undefined behavior.

Definition at line 135 of file piercedStorageIterator.tpp.

◆ operator++() [2/2]

template<typename value_t , typename id_t , typename value_no_cv_t >
PiercedStorageIterator< value_t, id_t, value_no_cv_t > bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator++ ( int )

Post-increment operator.

Increment operator does not check whether it crosses the end() of the container. Thus, calling this function if the iterator is already at the end of the container results in undefined behavior.

Definition at line 150 of file piercedStorageIterator.tpp.

◆ operator--() [1/2]

template<typename value_t , typename id_t , typename value_no_cv_t >
PiercedStorageIterator< value_t, id_t, value_no_cv_t > & bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator-- ( )

Pre-decrement operator.

Decrement operator does not check whether it crosses the begin() of the container. Thus, calling this function if the iterator is already at the begin of the container results in undefined behavior.

Definition at line 168 of file piercedStorageIterator.tpp.

◆ operator--() [2/2]

template<typename value_t , typename id_t , typename value_no_cv_t >
PiercedStorageIterator< value_t, id_t, value_no_cv_t > bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator-- ( int )

Post-decrement operator.

Decrement operator does not check whether it crosses the begin() of the container. Thus, calling this function if the iterator is already at the begin of the container results in undefined behavior.

Definition at line 183 of file piercedStorageIterator.tpp.

◆ operator->()

template<typename value_t , typename id_t , typename value_no_cv_t >
__PSI_POINTER__ bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator-> ( ) const

Deference operator.

Returns
A reference to the element currently pointed to by the iterator.

Definition at line 212 of file piercedStorageIterator.tpp.

◆ operator=()

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
template<typename other_value_t , typename std::enable_if< std::is_const< value_t >::value &&!std::is_const< other_value_t >::value &&std::is_same< other_value_t, typename std::remove_cv< value_t >::type >::value, int >::type >
PiercedStorageIterator< value_t, id_t, value_no_cv_t > & bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator= ( const PiercedStorageIterator< other_value_t, id_t, value_no_cv_t > & other)

Copy assignment operator to create a constant iterator from a non-constant one.

Parameters
otheris the iterator that will be copied

Definition at line 227 of file piercedStorageIterator.tpp.

◆ operator==()

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
bool bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::operator== ( const PiercedStorageIterator< value_t, id_t, value_no_cv_t > & rhs) const
inline

Two-way comparison.

Definition at line 164 of file piercedStorageIterator.hpp.

◆ swap()

template<typename value_t , typename id_t , typename value_no_cv_t >
void bitpit::PiercedStorageIterator< value_t, id_t, value_no_cv_t >::swap ( PiercedStorageIterator< value_t, id_t, value_no_cv_t > & other)
noexcept

Exchanges the values of the current iterator and the iterator recevied as argument.

Parameters
otherthe iterator to exchange values with

Definition at line 80 of file piercedStorageIterator.tpp.

Friends And Related Symbol Documentation

◆ PiercedStorage

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
template<typename PS_value_t , typename PS_id_t >
friend class PiercedStorage
friend

Definition at line 58 of file piercedStorageIterator.hpp.

◆ PiercedStorageIterator< typename std::add_const< value_t >::type, id_t, value_no_cv_t >

template<typename value_t , typename id_t = long, typename value_no_cv_t = typename std::remove_cv<value_t>::type>
friend class PiercedStorageIterator< typename std::add_const< value_t >::type, id_t, value_no_cv_t >
friend

Definition at line 1 of file piercedStorageIterator.hpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---