SUNphi  1.0
Flags.hpp File Reference

Defines collectable flags. More...

#include <ints/IntSeq.hpp>

Go to the source code of this file.

Functions

template<auto... Flags>
constexpr int SUNphi::_combineFlags ()
 

Variables

template<auto Flag>
constexpr int SUNphi::flagMask
 
template<auto... Flags>
constexpr int SUNphi::combineFlags
 
template<int InMask, auto... Flags>
constexpr int SUNphi::addFlags
 Add flags to a mask at compile time. More...
 
template<int InMask, auto... Flags>
constexpr int SUNphi::remFlags
 Remove flags to a mask at compile time. More...
 
template<int Mask, auto Flag>
constexpr bool SUNphi::getFlag
 Get a given flag from a mask. More...
 

Detailed Description

Defines collectable flags.

A flag is an integral value specifying the number of bits

Definition in file Flags.hpp.

Function Documentation

template<auto... Flags>
constexpr int SUNphi::_combineFlags ( )

Combine flags to form a mask at compile time

Internal implementation to catch error

Definition at line 27 of file Flags.hpp.

Variable Documentation

template<int InMask, auto... Flags>
constexpr int SUNphi::addFlags
Initial value:
=
InMask | combineFlags<Flags...>
constexpr int combineFlags
Definition: Flags.hpp:39

Add flags to a mask at compile time.

Definition at line 46 of file Flags.hpp.

template<auto... Flags>
constexpr int SUNphi::combineFlags
Initial value:
=
_combineFlags<Flags...>()
constexpr int _combineFlags()
Definition: Flags.hpp:27

Combine flags to form a mask at compile time

Gives visibility to internal implementation

Definition at line 39 of file Flags.hpp.

template<auto Flag>
constexpr int SUNphi::flagMask
Initial value:
=
1<<static_cast<int>(Flag)

Create a mask for a given flag

Shift right by the amount of bits

Definition at line 19 of file Flags.hpp.

template<int Mask, auto Flag>
constexpr bool SUNphi::getFlag
Initial value:
=
Mask & flagMask<Flag>

Get a given flag from a mask.

Definition at line 60 of file Flags.hpp.

template<int InMask, auto... Flags>
constexpr int SUNphi::remFlags
Initial value:
=
InMask & ~combineFlags<Flags...>
constexpr int combineFlags
Definition: Flags.hpp:39

Remove flags to a mask at compile time.

Definition at line 53 of file Flags.hpp.