Rebel Fork Framework
Urho3D::FlagSet< E > Class Template Reference

A set of flags defined by an Enum. More...

#include <Urho3D/Container/FlagSet.h>

Public Types

using Enum = E
 Enum type.
 
using Integer = typename std::underlying_type< Enum >::type
 Integer type.
 

Public Member Functions

constexpr FlagSet (Integer value)
 Ctor by integer.
 
constexpr FlagSet ()=default
 Empty constructor.
 
constexpr FlagSet (const FlagSet &another)=default
 Copy constructor.
 
constexpr FlagSet (const Enum value)
 Construct from Enum value.
 
constexpr FlagSetoperator= (const FlagSet &rhs)=default
 Assignment operator from flagset.
 
constexpr FlagSetoperator&= (const Enum value)
 Bitwise AND against Enum value.
 
constexpr FlagSetoperator&= (const FlagSet value)
 Bitwise AND against flagset value.
 
constexpr FlagSetoperator|= (const Enum value)
 Bitwise OR against Enum value.
 
constexpr FlagSetoperator|= (const FlagSet value)
 Bitwise OR against flagset value.
 
constexpr FlagSetoperator^= (const Enum value)
 Bitwise XOR against Enum value.
 
constexpr FlagSetoperator^= (const FlagSet value)
 Bitwise XOR against flagset value.
 
constexpr FlagSet operator& (const Enum value) const
 Bitwise AND against Enum value.
 
constexpr FlagSet operator& (const FlagSet value) const
 Bitwise AND against flagset value.
 
constexpr FlagSet operator| (const Enum value) const
 Bitwise OR against Enum value.
 
constexpr FlagSet operator| (const FlagSet value) const
 Bitwise OR against flagset value.
 
constexpr FlagSet operator^ (const Enum value) const
 Bitwise XOR against Enum value.
 
constexpr FlagSet operator^ (const FlagSet value) const
 Bitwise XOR against flagset value.
 
constexpr FlagSet operator~ () const
 Bitwise negation.
 
constexpr bool operator! () const
 Boolean negation.
 
constexpr operator bool () const
 Returns true if any flag is set.
 
constexpr operator Integer () const
 Cast to underlying type of enum.
 
constexpr operator Enum () const
 Cast to enum value.
 
 operator double () const
 Cast to double. Used by Lua bindings.
 
constexpr bool operator== (Enum rhs) const
 Equality check against enum value.
 
constexpr bool operator== (FlagSet rhs) const
 Equality check against another flagset.
 
constexpr bool operator!= (Enum rhs) const
 Non-equality check against enum value.
 
constexpr bool operator!= (FlagSet rhs) const
 Non-equality check against another flagset value.
 
constexpr bool Test (const Enum value) const
 Return true if specified enum value is set.
 
constexpr bool Test (const Integer flags) const
 Return true if specified bits are set.
 
constexpr Integer AsInteger () const
 Return underlying integer (constant).
 
constexpr IntegerAsInteger ()
 Return underlying integer (non-constant).
 
constexpr unsigned ToHash () const
 Return hash value.
 
constexpr void Set (const Integer flags, bool enabled=true)
 
constexpr void Set (const Enum value, bool enabled=true)
 
constexpr void Unset (const Integer flags)
 
constexpr void Unset (const Enum value)
 

Protected Attributes

Integer value_ = 0
 Value.
 

Detailed Description

template<class E>
class Urho3D::FlagSet< E >

A set of flags defined by an Enum.

Member Function Documentation

◆ Set()

template<class E >
constexpr void Urho3D::FlagSet< E >::Set ( const Integer  flags,
bool  enabled = true 
)
inlineconstexpr

Set or unset specified subset of flags


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