Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse > Class Template Reference

Bitset iterator. More...

#include <bitset_iterator.h>

Public Types

using value_type = uint32_t
 Bit-index value type.
 
using size_type = typename TBitset::size_type
 Backing-word type used by the parent bit set.
 

Public Member Functions

 bitset_const_iterator (const TBitset &bitset, value_type pos, bool fwd)
 
GAIA_NODISCARD value_type operator* () const
 Returns the current bit index.
 
GAIA_NODISCARD value_type operator-> () const
 Returns the current bit index for arrow-style access.
 
GAIA_NODISCARD value_type index () const
 Returns the current bit index.
 
bitset_const_iteratoroperator++ ()
 Advances to the next matching bit in the iterator's direction.
 
GAIA_NODISCARD bitset_const_iterator operator++ (int)
 Advances to the next matching bit in the iterator's direction.
 
GAIA_NODISCARD bool operator== (const bitset_const_iterator &other) const
 Compares iterator positions.
 
GAIA_NODISCARD bool operator!= (const bitset_const_iterator &other) const
 Compares iterator positions.
 

Detailed Description

template<typename TBitset, bool IsFwd, bool IsInverse>
class gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >

Bitset iterator.

Template Parameters
TBitsetIterator's bitset parent
IsFwdIf true the iterator moves forward. Backwards iterations otherwise.
IsInverseIf true, all values are inverse

Constructor & Destructor Documentation

◆ bitset_const_iterator()

template<typename TBitset , bool IsFwd, bool IsInverse>
gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::bitset_const_iterator ( const TBitset bitset,
value_type  pos,
bool  fwd 
)
inline
Parameters
bitsetParent bit set.
posInitial bit position or boundary.
fwdTrue to search toward increasing indices. False to search toward decreasing indices.

Member Function Documentation

◆ index()

template<typename TBitset , bool IsFwd, bool IsInverse>
GAIA_NODISCARD value_type gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::index ( ) const
inline

Returns the current bit index.

Returns
Current matching bit index.

◆ operator!=()

template<typename TBitset , bool IsFwd, bool IsInverse>
GAIA_NODISCARD bool gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::operator!= ( const bitset_const_iterator< TBitset, IsFwd, IsInverse > &  other) const
inline

Compares iterator positions.

Parameters
otherIterator to compare with.
Returns
True when the iterators have different positions.

◆ operator*()

template<typename TBitset , bool IsFwd, bool IsInverse>
GAIA_NODISCARD value_type gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::operator* ( ) const
inline

Returns the current bit index.

Returns
Current matching bit index.

◆ operator++() [1/2]

template<typename TBitset , bool IsFwd, bool IsInverse>
bitset_const_iterator & gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::operator++ ( )
inline

Advances to the next matching bit in the iterator's direction.

Returns
This iterator after advancement.

◆ operator++() [2/2]

template<typename TBitset , bool IsFwd, bool IsInverse>
GAIA_NODISCARD bitset_const_iterator gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::operator++ ( int  )
inline

Advances to the next matching bit in the iterator's direction.

Returns
Iterator value before advancement.

◆ operator->()

template<typename TBitset , bool IsFwd, bool IsInverse>
GAIA_NODISCARD value_type gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::operator-> ( ) const
inline

Returns the current bit index for arrow-style access.

Returns
Current matching bit index.

◆ operator==()

template<typename TBitset , bool IsFwd, bool IsInverse>
GAIA_NODISCARD bool gaia::cnt::bitset_const_iterator< TBitset, IsFwd, IsInverse >::operator== ( const bitset_const_iterator< TBitset, IsFwd, IsInverse > &  other) const
inline

Compares iterator positions.

Parameters
otherIterator to compare with.
Returns
True when both iterators have the same position.

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