ros2_control - rolling
|
This class allows us to handle flags easily, instead of using strings. More...
#include <gz_system_interface.hpp>
Public Member Functions | |
SafeEnum (ENUM singleFlag) | |
SafeEnum (const SafeEnum &original) | |
SafeEnum & | operator|= (ENUM addValue) |
SafeEnum | operator| (ENUM addValue) |
SafeEnum & | operator&= (ENUM maskValue) |
SafeEnum | operator& (ENUM maskValue) |
SafeEnum | operator~ () |
operator bool () | |
Protected Attributes | |
UNDERLYING | mFlags |
This class allows us to handle flags easily, instead of using strings.
For example enum ControlMethod_ { NONE = 0, POSITION = (1 << 0), VELOCITY = (1 << 1), EFFORT = (1 << 2), }; typedef SafeEnum<enum ControlMethod_> ControlMethod;
ControlMethod foo; foo |= POSITION // Foo has the position flag active foo & POSITION -> True // Check if position is active in the flag foo & VELOCITY -> False // Check if velocity is active in the flag