Template Class SafeEnum
Defined in File ign_system_interface.hpp
Class Documentation
-
template<class ENUM, class UNDERLYING = typename std::underlying_type<ENUM>::type>
class SafeEnum 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
Protected Attributes
-
UNDERLYING mFlags
-
UNDERLYING mFlags