Base Framework
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
BitSet::BitSetEnumerator Class Reference

Non-modifying enumerator of elements of a bit set. More...

#include <base/collection/BitSet.h>

Inherits Enumerator< TRAITS >.

Inherited by BitSet::BitSetReadEnumerator.

Public Member Functions

 BitSetEnumerator (const BitSetEnumerator &copy) noexcept
 
bool hasNext () const noexcept
 
Reference next ()
 
bool operator== (const BitSetEnumerator &compare) const noexcept
 
bool operator!= (const BitSetEnumerator &compare) const noexcept
 
- Public Member Functions inherited from Enumerator< TRAITS >
virtual ~Enumerator ()
 

Protected Types

typedef Enumerator< EnumeratorTraits >::Value Value
 
typedef Enumerator< EnumeratorTraits >::Reference Reference
 
typedef Enumerator< EnumeratorTraits >::Pointer Pointer
 

Protected Member Functions

 BitSetEnumerator (unsigned long *_word, unsigned int _count) noexcept
 

Protected Attributes

unsigned long * word = nullptr
 
unsigned int count = 0
 
Reference current
 

Additional Inherited Members

- Public Types inherited from Enumerator< TRAITS >
typedef TRAITS::Value Value
 
typedef TRAITS::Distance Distance
 
typedef TRAITS::Reference Reference
 
typedef TRAITS::Pointer Pointer
 

Detailed Description

Non-modifying enumerator of elements of a bit set.

Enumerator of elements of a bit set.

Version
1.0
Examples
testsuite/BitSet.cpp.

Constructor & Destructor Documentation

◆ BitSetEnumerator() [1/2]

BitSet::BitSetEnumerator::BitSetEnumerator ( unsigned long *  _word,
unsigned int  _count 
)
inlineexplicitprotectednoexcept

Initializes an enumeration of all the elements of a bit set.

Parameters
wordSpecifies the beginning of the enumeration.
countThe number of bits in the set.

◆ BitSetEnumerator() [2/2]

BitSet::BitSetEnumerator::BitSetEnumerator ( const BitSetEnumerator copy)
inlinenoexcept

Initializes enumeration from other enumeration.

Member Function Documentation

◆ hasNext()

bool BitSet::BitSetEnumerator::hasNext ( ) const
inlinevirtualnoexcept

Returns true if the enumeration still contains elements.

Implements Enumerator< TRAITS >.

Reimplemented in BitSet::BitSetReadEnumerator.

Examples
testsuite/BitSet.cpp.

◆ next()

Reference BitSet::BitSetEnumerator::next ( )
inlinevirtual

Returns the next element and advances the position of this enumeration.

Implements Enumerator< TRAITS >.

Reimplemented in BitSet::BitSetReadEnumerator.

Examples
testsuite/BitSet.cpp.

◆ operator!=()

bool BitSet::BitSetEnumerator::operator!= ( const BitSetEnumerator compare) const
inlinenoexcept

Returns true if the enumerations aren't pointing to the same position.

◆ operator==()

bool BitSet::BitSetEnumerator::operator== ( const BitSetEnumerator compare) const
inlinenoexcept

Returns true if the enumerations are pointing to the same position.

Member Data Documentation

◆ count

unsigned int BitSet::BitSetEnumerator::count = 0
protected

The number of bits left.

◆ current

Reference BitSet::BitSetEnumerator::current
protected

Current position.

◆ word

unsigned long* BitSet::BitSetEnumerator::word = nullptr
protected

The current position in the enumeration.