Loading...
Searching...
No Matches
bitpit::PiercedKernelIterator< id_t > Class Template Reference

Iterator for the class PiercedKernel. More...

#include <piercedKernelIterator.hpp>

Inheritance diagram for bitpit::PiercedKernelIterator< id_t >:

Public Types

using difference_type = std::ptrdiff_t
 
typedef id_t id_type
 
using iterator_category = std::bidirectional_iterator_tag
 
typedef kernel_t kernel_type
 
using pointer = id_t *
 
using reference = id_t &
 
using value_type = id_t
 

Public Member Functions

 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
 

Friends

template<typename PK_id_t>
class PiercedKernel
 
template<typename PSI_value_t, typename PSI_id_t, typename PSI_value_no_cv_t>
class PiercedStorageIterator
 

Detailed Description

template<typename id_t = long>
class bitpit::PiercedKernelIterator< id_t >

Iterator for the class PiercedKernel.

Template Parameters
id_tis the type of ids associated to the elements

Definition at line 46 of file piercedKernelIterator.hpp.

Member Typedef Documentation

◆ difference_type

template<typename id_t = long>
using bitpit::PiercedKernelIterator< id_t >::difference_type = std::ptrdiff_t

Difference type

Definition at line 84 of file piercedKernelIterator.hpp.

◆ id_type

template<typename id_t = long>
typedef id_t bitpit::PiercedKernelIterator< id_t >::id_type

Type of ids in the kernel

Definition at line 104 of file piercedKernelIterator.hpp.

◆ iterator_category

template<typename id_t = long>
using bitpit::PiercedKernelIterator< id_t >::iterator_category = std::bidirectional_iterator_tag

Iterator category

Definition at line 74 of file piercedKernelIterator.hpp.

◆ kernel_type

template<typename id_t = long>
typedef kernel_t bitpit::PiercedKernelIterator< id_t >::kernel_type

Kernel type

Definition at line 99 of file piercedKernelIterator.hpp.

◆ pointer

template<typename id_t = long>
using bitpit::PiercedKernelIterator< id_t >::pointer = id_t *

Pointer type

Definition at line 89 of file piercedKernelIterator.hpp.

◆ reference

template<typename id_t = long>
using bitpit::PiercedKernelIterator< id_t >::reference = id_t &

Reference type

Definition at line 94 of file piercedKernelIterator.hpp.

◆ value_type

template<typename id_t = long>
using bitpit::PiercedKernelIterator< id_t >::value_type = id_t

Value type

Definition at line 79 of file piercedKernelIterator.hpp.

Constructor & Destructor Documentation

◆ PiercedKernelIterator()

template<typename id_t>
bitpit::PiercedKernelIterator< id_t >::PiercedKernelIterator ( )

Creates a new uninitialized iterator

Definition at line 34 of file piercedKernelIterator.tpp.

Member Function Documentation

◆ getId()

template<typename id_t>
id_t bitpit::PiercedKernelIterator< id_t >::getId ( const id_t & fallback = -1) const
noexcept

Gets the id of the current element.

Returns
The id of the current element or the fallback value if the iterator points to an invalid position.

Definition at line 80 of file piercedKernelIterator.tpp.

◆ getKernel()

template<typename id_t>
const PiercedKernelIterator< id_t >::kernel_type & bitpit::PiercedKernelIterator< id_t >::getKernel ( ) const

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

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

Definition at line 68 of file piercedKernelIterator.tpp.

◆ getPos()

template<typename id_t>
std::size_t bitpit::PiercedKernelIterator< id_t >::getPos ( ) const
noexcept

Gets the position of the current element.

Returns
The position of the current element.

Definition at line 114 of file piercedKernelIterator.tpp.

◆ getRawIndex()

template<typename id_t>
std::size_t bitpit::PiercedKernelIterator< id_t >::getRawIndex ( ) const
noexcept

Gets the position of the current element.

Returns
The position of the current element.

Definition at line 103 of file piercedKernelIterator.tpp.

◆ operator!=()

template<typename id_t = long>
bool bitpit::PiercedKernelIterator< id_t >::operator!= ( const PiercedKernelIterator< id_t > & rhs) const
inline

Two-way comparison.

Definition at line 140 of file piercedKernelIterator.hpp.

◆ operator*()

template<typename id_t>
const id_t & bitpit::PiercedKernelIterator< id_t >::operator* ( ) const

Deference operator.

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

Definition at line 223 of file piercedKernelIterator.tpp.

◆ operator++() [1/2]

template<typename id_t>
PiercedKernelIterator< id_t > & bitpit::PiercedKernelIterator< id_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 127 of file piercedKernelIterator.tpp.

◆ operator++() [2/2]

template<typename id_t>
PiercedKernelIterator< id_t > bitpit::PiercedKernelIterator< id_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 159 of file piercedKernelIterator.tpp.

◆ operator--() [1/2]

template<typename id_t>
PiercedKernelIterator< id_t > & bitpit::PiercedKernelIterator< id_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 176 of file piercedKernelIterator.tpp.

◆ operator--() [2/2]

template<typename id_t>
PiercedKernelIterator< id_t > bitpit::PiercedKernelIterator< id_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 208 of file piercedKernelIterator.tpp.

◆ operator->()

template<typename id_t>
const id_t * bitpit::PiercedKernelIterator< id_t >::operator-> ( ) const

Deference operator.

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

Definition at line 234 of file piercedKernelIterator.tpp.

◆ operator==()

template<typename id_t = long>
bool bitpit::PiercedKernelIterator< id_t >::operator== ( const PiercedKernelIterator< id_t > & rhs) const
inline

Two-way comparison.

Definition at line 132 of file piercedKernelIterator.hpp.

◆ swap()

template<typename id_t>
void bitpit::PiercedKernelIterator< id_t >::swap ( PiercedKernelIterator< id_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 56 of file piercedKernelIterator.tpp.

Friends And Related Symbol Documentation

◆ PiercedKernel

template<typename id_t = long>
template<typename PK_id_t>
friend class PiercedKernel
friend

Definition at line 50 of file piercedKernelIterator.hpp.

◆ PiercedStorageIterator

template<typename id_t = long>
template<typename PSI_value_t, typename PSI_id_t, typename PSI_value_no_cv_t>
friend class PiercedStorageIterator
friend

Definition at line 53 of file piercedKernelIterator.hpp.


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