DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Holds a bitset containing flags to indicate which features a certain instrument/ module etc. supports. More...
#include <Util.h>
Public Member Functions | |
constexpr | FeatureTester () noexcept=default |
Constructs a FeatureTester instance with no flags set. | |
template<size_t N> | |
FeatureTester (const std::array< EnumType, N > &Flags) | |
Constructs a FeatureTester instance with the Flags passed as an array being set. | |
template<size_t N> | |
bool | Test (const std::array< EnumType, N > &Flags) const |
Tests whether all of the flags passed as an array are set. | |
bool | Test (EnumType Flag) const |
Tests whether a single flag is set. | |
void | Set (EnumType Flag) |
Sets a flag. | |
Private Attributes | |
std::bitset< static_cast< size_t >(EnumType::NUM_ELEMENTS)> | Features |
Bitset containing the flags and their states. | |
Holds a bitset containing flags to indicate which features a certain instrument/ module etc. supports.
EnumType | Enum class type containing flags the respective FeatureTester operates on. NUM_ELEMENTS must be the last element in EnumType. No values must be assigned to the enum's elements! |
|
constexprdefaultnoexcept |
Constructs a FeatureTester instance with no flags set.
|
inline |
Constructs a FeatureTester instance with the Flags passed as an array being set.
N | Amount of flags contained in Flags . Automatically derived. Do not specify. |
Flags | Flags to set |
|
inline |
|
inline |
Tests whether all of the flags passed as an array are set.
N | Amount of flags contained in Flags . Automatically derived. Do not specify. |
Flags | Flags Flags to check |
Flags
are set, false otherwise.
|
inline |
|
private |