MCKL
Monte Carlo Kernel Library
Public Types | Public Member Functions | Friends | List of all members
mckl::ParticleIndex< T > Class Template Referencefinal

A thin wrapper over a complete Particle. More...

#include <mckl/core/particle.hpp>

Inherits ParticleIndexBaseType< T >.

Public Types

using difference_type = std::make_signed_t< typename Particle< T >::size_type >
 
using iterator_category = std::random_access_iterator_tag
 
using pointer = const ParticleIndex *
 
using reference = const ParticleIndex &
 
using value_type = ParticleIndex
 

Public Member Functions

 ParticleIndex ()=default
 
 ParticleIndex (typename Particle< T >::size_type i, Particle< T > *pptr)
 
reference operator* () const noexcept
 Dereference operator returns a reference to the index itself. More...
 
pointer operator-> () const noexcept
 Member selection operator returns a pointer the index itself. More...
 
template<typename IntType >
ParticleIndex operator[] (IntType n)
 Subscript operator return a new index. More...
 

Friends

bool operator!= (const ParticleIndex &idx1, const ParticleIndex &idx2)
 
template<typename IntType >
ParticleIndex operator+ (const ParticleIndex &idx, IntType n)
 
template<typename IntType >
ParticleIndex operator+ (IntType n, const ParticleIndex &idx)
 
ParticleIndexoperator++ (ParticleIndex &idx)
 
ParticleIndex operator++ (ParticleIndex &idx, int)
 
template<typename IntType >
ParticleIndexoperator+= (ParticleIndex &idx, IntType n)
 
template<typename IntType >
ParticleIndex operator- (const ParticleIndex &idx, IntType n)
 
difference_type operator- (const ParticleIndex &idx1, const ParticleIndex &idx2)
 
ParticleIndexoperator-- (ParticleIndex &idx)
 
ParticleIndex operator-- (ParticleIndex &idx, int)
 
template<typename IntType >
ParticleIndexoperator-= (ParticleIndex &idx, IntType n)
 
bool operator< (const ParticleIndex &idx1, const ParticleIndex &idx2)
 
bool operator<= (const ParticleIndex &idx1, const ParticleIndex &idx2)
 
bool operator== (const ParticleIndex &idx1, const ParticleIndex &idx2)
 
bool operator> (const ParticleIndex &idx1, const ParticleIndex &idx2)
 
bool operator>= (const ParticleIndex &idx1, const ParticleIndex &idx2)
 

Detailed Description

template<typename T>
class mckl::ParticleIndex< T >

A thin wrapper over a complete Particle.

This class also serves as an random access iterator

Definition at line 86 of file particle.hpp.

Member Typedef Documentation

◆ difference_type

template<typename T>
using mckl::ParticleIndex< T >::difference_type = std::make_signed_t<typename Particle<T>::size_type>

Definition at line 90 of file particle.hpp.

◆ iterator_category

template<typename T>
using mckl::ParticleIndex< T >::iterator_category = std::random_access_iterator_tag

Definition at line 94 of file particle.hpp.

◆ pointer

template<typename T>
using mckl::ParticleIndex< T >::pointer = const ParticleIndex *

Definition at line 92 of file particle.hpp.

◆ reference

template<typename T>
using mckl::ParticleIndex< T >::reference = const ParticleIndex &

Definition at line 93 of file particle.hpp.

◆ value_type

template<typename T>
using mckl::ParticleIndex< T >::value_type = ParticleIndex

Definition at line 91 of file particle.hpp.

Constructor & Destructor Documentation

◆ ParticleIndex() [1/2]

template<typename T>
mckl::ParticleIndex< T >::ParticleIndex ( )
default

◆ ParticleIndex() [2/2]

template<typename T>
mckl::ParticleIndex< T >::ParticleIndex ( typename Particle< T >::size_type  i,
Particle< T > *  pptr 
)
inline

Definition at line 98 of file particle.hpp.

Member Function Documentation

◆ operator*()

template<typename T>
reference mckl::ParticleIndex< T >::operator* ( ) const
inlinenoexcept

Dereference operator returns a reference to the index itself.

Definition at line 104 of file particle.hpp.

◆ operator->()

template<typename T>
pointer mckl::ParticleIndex< T >::operator-> ( ) const
inlinenoexcept

Member selection operator returns a pointer the index itself.

Definition at line 107 of file particle.hpp.

◆ operator[]()

template<typename T>
template<typename IntType >
ParticleIndex mckl::ParticleIndex< T >::operator[] ( IntType  n)
inline

Subscript operator return a new index.

Definition at line 111 of file particle.hpp.

Friends And Related Function Documentation

◆ operator!=

template<typename T>
bool operator!= ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 129 of file particle.hpp.

◆ operator+ [1/2]

template<typename T>
template<typename IntType >
ParticleIndex operator+ ( const ParticleIndex< T > &  idx,
IntType  n 
)
friend

Definition at line 204 of file particle.hpp.

◆ operator+ [2/2]

template<typename T>
template<typename IntType >
ParticleIndex operator+ ( IntType  n,
const ParticleIndex< T > &  idx 
)
friend

Definition at line 213 of file particle.hpp.

◆ operator++ [1/2]

template<typename T>
ParticleIndex& operator++ ( ParticleIndex< T > &  idx)
friend

Definition at line 177 of file particle.hpp.

◆ operator++ [2/2]

template<typename T>
ParticleIndex operator++ ( ParticleIndex< T > &  idx,
int   
)
friend

Definition at line 182 of file particle.hpp.

◆ operator+=

template<typename T>
template<typename IntType >
ParticleIndex& operator+= ( ParticleIndex< T > &  idx,
IntType  n 
)
friend

Definition at line 225 of file particle.hpp.

◆ operator- [1/2]

template<typename T>
template<typename IntType >
ParticleIndex operator- ( const ParticleIndex< T > &  idx,
IntType  n 
)
friend

Definition at line 219 of file particle.hpp.

◆ operator- [2/2]

template<typename T>
difference_type operator- ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 236 of file particle.hpp.

◆ operator-- [1/2]

template<typename T>
ParticleIndex& operator-- ( ParticleIndex< T > &  idx)
friend

Definition at line 190 of file particle.hpp.

◆ operator-- [2/2]

template<typename T>
ParticleIndex operator-- ( ParticleIndex< T > &  idx,
int   
)
friend

Definition at line 195 of file particle.hpp.

◆ operator-=

template<typename T>
template<typename IntType >
ParticleIndex& operator-= ( ParticleIndex< T > &  idx,
IntType  n 
)
friend

Definition at line 231 of file particle.hpp.

◆ operator<

template<typename T>
bool operator< ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 139 of file particle.hpp.

◆ operator<=

template<typename T>
bool operator<= ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 157 of file particle.hpp.

◆ operator==

template<typename T>
bool operator== ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 119 of file particle.hpp.

◆ operator>

template<typename T>
bool operator> ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 148 of file particle.hpp.

◆ operator>=

template<typename T>
bool operator>= ( const ParticleIndex< T > &  idx1,
const ParticleIndex< T > &  idx2 
)
friend

Definition at line 167 of file particle.hpp.