AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ABitField< T > Class Template Reference

Bit field implementation. More...

Detailed Description

template<typename T = uint32_t>
class ABitField< T >

Bit field implementation.

Public Member Functions

 ABitField (T storage=static_cast< T >(0))
 
 operator T ()
 
T & value ()
 
const T & value () const
 
ABitFieldoperator<< (T flag)
 Sets flag. More...
 
ABitFieldoperator>> (T flag)
 Resets flag. More...
 
bool checkAndSet (T flag)
 Determines whether flag set or not and resets flag. More...
 
bool checkAndReset (T flag)
 Determines whether flag set or not and sets flag. More...
 
bool test (T flags) const
 Determines whether flag (or all flags) set or not. More...
 
bool testAny (T flags) const
 Determines whether flag (or one of the flags flags) set or not. More...
 
bool operator& (T flags) const
 Determines whether flag(s) set or not. More...
 
void set (T flag, bool value)
 

Member Function Documentation

◆ checkAndReset()

template<typename T = uint32_t>
bool ABitField< T >::checkAndReset ( flag)
inline

Determines whether flag set or not and sets flag.

Parameters
flagflag
Returns
true if flag was reset

◆ checkAndSet()

template<typename T = uint32_t>
bool ABitField< T >::checkAndSet ( flag)
inline

Determines whether flag set or not and resets flag.

Parameters
flagflag
Returns
true if flag was set

◆ operator&()

template<typename T = uint32_t>
bool ABitField< T >::operator& ( flags) const
inline

Determines whether flag(s) set or not.

Parameters
flagsflag(s)
Returns
true if flag(s) set
Note
This function supports multiple flags (i.e check(FLAG1 | FLAG2)).

◆ operator<<()

template<typename T = uint32_t>
ABitField & ABitField< T >::operator<< ( flag)
inline

Sets flag.

Parameters
flagflag
Returns
this

◆ operator>>()

template<typename T = uint32_t>
ABitField & ABitField< T >::operator>> ( flag)
inline

Resets flag.

Parameters
flagflag
Returns
this

◆ test()

template<typename T = uint32_t>
bool ABitField< T >::test ( flags) const
inline

Determines whether flag (or all flags) set or not.

Parameters
flagsflag(s)
Returns
true if flag(s) set
Note
This function supports multiple flags (i.e check(FLAG1 | FLAG2)).

◆ testAny()

template<typename T = uint32_t>
bool ABitField< T >::testAny ( flags) const
inline

Determines whether flag (or one of the flags flags) set or not.

Parameters
flagsflag(s)
Returns
true if flag(s) set
Note
This function supports multiple flags (i.e check(FLAG1 | FLAG2)).

#include <AUI/Util/ABitField.h>


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