30#ifndef __BASE_FLAGS_HH__
31#define __BASE_FLAGS_HH__
47 static_assert(std::is_unsigned_v<T>,
"Flag type must be unsigned");
Wrapper that groups a few flag bits under the same undelying container.
T _flags
The undelying container of the flags' bits.
void set(Type mask)
Set all flag's bits matching the given mask.
Flags(Type flags=0)
Initialize flags with a given value.
bool allSet(Type mask) const
Verifies whether no bits matching the given mask are set.
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
void clear()
Clear all flag's bits.
void clear(Type mask)
Clear all flag's bits matching the given mask.
void replace(Type flags, Type mask)
Replace the contents of the bits matching the mask with the corresponding bits in the provided flags.
void set(Type mask, bool condition)
Conditionally set or clear some bits of the flag, given a mask.
bool noneSet(Type mask) const
Verifies whether no bits matching the given mask are set.
const Flags< T > & operator=(T flags)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.