ezEngine  Release 25.03
ezBitIterator< DataType, ReturnsIndex, ReturnType, StorageType > Struct Template Reference

#include <BitIterator.h>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = DataType
 

Public Member Functions

EZ_ALWAYS_INLINE ezBitIterator (DataType data)
 
EZ_ALWAYS_INLINE bool IsValid () const
 
EZ_ALWAYS_INLINE ReturnType Value () const
 
EZ_ALWAYS_INLINE void Next ()
 
EZ_ALWAYS_INLINE bool operator== (const ezBitIterator &other) const
 
EZ_ALWAYS_INLINE bool operator!= (const ezBitIterator &other) const
 
EZ_ALWAYS_INLINE ReturnType operator* () const
 
EZ_ALWAYS_INLINE void operator++ ()
 

Public Attributes

StorageType m_uiMask = 0
 

Detailed Description

template<typename DataType, bool ReturnsIndex = true, typename ReturnType = DataType, typename StorageType = typename ezBitIteratorStorage<DataType>::Type>
struct ezBitIterator< DataType, ReturnsIndex, ReturnType, StorageType >

Configurable bit iterator. Allows for iterating over the bits in an integer, returning either the bit index or value.

Template Parameters
DataTypeThe type of data that is being iterated over.
ReturnsIndexIf set, returns the index of the bit. Otherwise returns the value of the bit, i.e. EZ_BIT(value).
ReturnTypeReturned value type of the iterator. Defaults to same as DataType.
StorageTypeThe storage type that the bit operations are performed on (either ezUInt32 or ezUInt64). Auto-computed.

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