![]() |
ChimeraTK-DeviceAccess 03.25.00
|
Set of AccessMode flags with additional functionality for an easier handling. More...
#include <AccessMode.h>
Public Member Functions | |
| AccessModeFlags (std::set< AccessMode > flags) | |
| Constructor initialises from a std::set<AccessMode> | |
| AccessModeFlags (const std::initializer_list< AccessMode > &flags) | |
| Constructor initialises from a brace initialiser list (e.g. | |
| AccessModeFlags ()=default | |
| bool | has (AccessMode flag) const |
| Check if a certain flag is in the set. | |
| bool | empty () const |
| Check if the set is empty (i.e. | |
| void | checkForUnknownFlags (const std::set< AccessMode > &knownFlags) const |
| Check of any flag which is not in the given set "knownFlags" is set. | |
| bool | operator== (const AccessModeFlags &other) const |
| Check whether two sets of acces mode flags are the same. | |
| bool | operator< (const AccessModeFlags &other) const |
| "Less than" operator, e.g. | |
| void | remove (AccessMode flag) |
| Remove the given flag from the set. | |
| void | add (AccessMode flag) |
| Add the given flag to the set. | |
| std::string | serialize () const |
| Get a comma seperated list of all flag strings contained in the class. | |
Static Public Member Functions | |
| static const std::string & | getString (AccessMode flag) |
| Get a string representation of the given flag. | |
| static AccessModeFlags | deserialize (const std::string &listOfflags) |
| Get an AcessModeFlags object from a comma seperated list of flag strings. | |
Set of AccessMode flags with additional functionality for an easier handling.
The set holds flags which are enabled for an accessor. The method has() can be used to check wheater a flag is set.
Definition at line 48 of file AccessMode.h.
|
explicit |
Constructor initialises from a std::set<AccessMode>
Definition at line 12 of file AccessMode.cc.
| ChimeraTK::AccessModeFlags::AccessModeFlags | ( | const std::initializer_list< AccessMode > & | flags | ) |
Constructor initialises from a brace initialiser list (e.g.
"{AccessMode::raw}"). Hint: You can use the brace nitialiser list also without explicitly using the class name, when calling a function which has an argument of the type AccessModeFlags.
Definition at line 16 of file AccessMode.cc.
|
default |
| void ChimeraTK::AccessModeFlags::add | ( | AccessMode | flag | ) |
Add the given flag to the set.
Definition at line 62 of file AccessMode.cc.
| void ChimeraTK::AccessModeFlags::checkForUnknownFlags | ( | const std::set< AccessMode > & | knownFlags | ) | const |
Check of any flag which is not in the given set "knownFlags" is set.
If an unknown flag has been found, a ChimeraTK::logic_error is raised.
Definition at line 32 of file AccessMode.cc.
|
static |
Get an AcessModeFlags object from a comma seperated list of flag strings.
Definition at line 87 of file AccessMode.cc.
| bool ChimeraTK::AccessModeFlags::empty | ( | ) | const |
|
static |
Get a string representation of the given flag.
Definition at line 81 of file AccessMode.cc.
| bool ChimeraTK::AccessModeFlags::has | ( | AccessMode | flag | ) | const |
Check if a certain flag is in the set.
Definition at line 20 of file AccessMode.cc.
| bool ChimeraTK::AccessModeFlags::operator< | ( | const AccessModeFlags & | other | ) | const |
| bool ChimeraTK::AccessModeFlags::operator== | ( | const AccessModeFlags & | other | ) | const |
Check whether two sets of acces mode flags are the same.
Definition at line 42 of file AccessMode.cc.
| void ChimeraTK::AccessModeFlags::remove | ( | AccessMode | flag | ) |
Remove the given flag from the set.
Definition at line 56 of file AccessMode.cc.
| std::string ChimeraTK::AccessModeFlags::serialize | ( | ) | const |
Get a comma seperated list of all flag strings contained in the class.
Definition at line 68 of file AccessMode.cc.