- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
qi::Flags< Type > Class Template Reference

`#include <flags.hpp>`

## Public Types
using | type = Type
using | underlying_type = ka::Decay< decltype(underlying(std::declval< Type >()))>

## Public Member Functions
| Flags ()
| Flags (std::initializer_list< Type > values)
| std::bit_or ()))
| Flags (const Type &t)
bool | test (const Type &t) const
Flags & | set (const Type &t)
Flags & | reset (const Type &t)

## Public Attributes
| underlying_type {}

## Friends
const underlying_type & | underlying (const Flags &f)
Flags | operator& (const Flags &a, const Flags &b)
Flags | operator| (const Flags &a, const Flags &b)
Flags | operator^ (const Flags &a, const Flags &b)
Flags | operator~ (const Flags &a)
Flags & | operator|= (Flags &a, const Flags &b)
Flags & | operator&= (Flags &a, const Flags &b)
Flags & | operator^= (Flags &a, const Flags &b)

## Detailed Description

### template<typename Type>
class qi::Flags< Type >

Class providing type-safe flags semantics for bitwise combinable types.

Example: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ enum class BehaviorOption { MoveAround, MoveArms, Speak, }; using Opt = BehaviorOption; using F = Flags<Opt>; F flags = F({Opt::MoveAround, Opt::Speak});

// or

F flags; flags.set(Opt::MoveArms).set(Opt::MoveAround);

// or

F flags1 = F{Opt::MoveAround}; F flags2 = F{Opt::MoveArms}; F flags3 = flags2; F flags = ( flags1 | flags2 ) & flags3; // flags == flags2

// ... startBehavior(flags); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/

HasUnderlying<BitmaskType> Type

Definition at line 60 of file flags.hpp.

## Member Typedef Documentation

template<typename Type>

using qi::Flags< Type >::type = Type

Definition at line 63 of file flags.hpp.

template<typename Type>

using qi::Flags< Type >::underlying_type = ka::Decay<decltype(underlying(std::declval<Type>()))>

Definition at line 64 of file flags.hpp.

## Constructor & Destructor Documentation

template<typename Type>

qi::Flags< Type >::Flags | ( |  | ) |
| inline

Definition at line 73 of file flags.hpp.

template<typename Type>

qi::Flags< Type >::Flags | ( | std::initializer_list< Type > | values | ) |
| inline explicit

Definition at line 86 of file flags.hpp.

template<typename Type>

qi::Flags< Type >::Flags | ( | const Type & | t | ) |
| inline explicit

Definition at line 92 of file flags.hpp.

## Member Function Documentation

template<typename Type>

Flags& qi::Flags< Type >::reset | ( | const Type & | t | ) |
| inline

Definition at line 107 of file flags.hpp.

template<typename Type>

Flags& qi::Flags< Type >::set | ( | const Type & | t | ) |
| inline

Definition at line 101 of file flags.hpp.

template<typename Type>

qi::Flags< Type >::std::bit_or | ( |  | ) |
| inline

Definition at line 89 of file flags.hpp.

template<typename Type>

bool qi::Flags< Type >::test | ( | const Type & | t | ) | const
| inline

Definition at line 96 of file flags.hpp.

## Friends And Related Function Documentation

template<typename Type>

Flags operator& | ( | const Flags< Type > & | a,
|  | const Flags< Type > & | b
| ) |  |
| friend

Definition at line 113 of file flags.hpp.

template<typename Type>

Flags& operator&= | ( | Flags< Type > & | a,
|  | const Flags< Type > & | b
| ) |  |
| friend

Definition at line 139 of file flags.hpp.

template<typename Type>

Flags operator^ | ( | const Flags< Type > & | a,
|  | const Flags< Type > & | b
| ) |  |
| friend

Definition at line 123 of file flags.hpp.

template<typename Type>

Flags& operator^= | ( | Flags< Type > & | a,
|  | const Flags< Type > & | b
| ) |  |
| friend

Definition at line 145 of file flags.hpp.

template<typename Type>

Flags operator| | ( | const Flags< Type > & | a,
|  | const Flags< Type > & | b
| ) |  |
| friend

Definition at line 118 of file flags.hpp.

template<typename Type>

Flags& operator|= | ( | Flags< Type > & | a,
|  | const Flags< Type > & | b
| ) |  |
| friend

Definition at line 133 of file flags.hpp.

template<typename Type>

Flags operator~ | ( | const Flags< Type > & | a | ) |
| friend

Definition at line 128 of file flags.hpp.

template<typename Type>

const underlying_type& underlying | ( | const Flags< Type > & | f | ) |
| friend

Definition at line 80 of file flags.hpp.

## Member Data Documentation

template<typename Type>

qi::Flags< Type >::underlying_type {}

Definition at line 88 of file flags.hpp.

The documentation for this class was generated from the following file:

- /home/opennao/work/release-2.8/sdk/libqi/qi/flags.hpp