Flags< Enum, Storage > Class Template Reference

Description

template<typename Enum, typename Storage = UINT32>
class bs::Flags< Enum, Storage >

Wrapper around an enum that allows simple use of bitwise logic operations.

Methods

 Flags (Enum value)
 
 Flags (const Flags< Enum, Storage > &value)
 
 Flags (Storage bits)
 
bool isSet (Enum value) const
 Checks whether all of the provided bits are set.
 
Flags< Enum, Storage > & set (Enum value)
 Activates all of the provided bits. More...
 
void unset (Enum value)
 Deactivates all of the provided bits. More...
 
bool operator== (Enum rhs) const
 
bool operator== (const Flags< Enum, Storage > &rhs) const
 
bool operator== (bool rhs) const
 
bool operator!= (Enum rhs) const
 
bool operator!= (const Flags< Enum, Storage > &rhs) const
 
Flags< Enum, Storage > & operator= (Enum rhs)
 
Flags< Enum, Storage > & operator= (const Flags< Enum, Storage > &rhs)
 
Flags< Enum, Storage > & operator|= (Enum rhs)
 
Flags< Enum, Storage > & operator|= (const Flags< Enum, Storage > &rhs)
 
Flags< Enum, Storage > operator| (Enum rhs) const
 
Flags< Enum, Storage > operator| (const Flags< Enum, Storage > &rhs) const
 
Flags< Enum, Storage > & operator&= (Enum rhs)
 
Flags< Enum, Storage > & operator&= (const Flags< Enum, Storage > &rhs)
 
Flags< Enum, Storage > operator& (Enum rhs) const
 
Flags< Enum, Storage > operator& (const Flags< Enum, Storage > &rhs) const
 
Flags< Enum, Storage > & operator^= (Enum rhs)
 
Flags< Enum, Storage > & operator^= (const Flags< Enum, Storage > &rhs)
 
Flags< Enum, Storage > operator^ (Enum rhs) const
 
Flags< Enum, Storage > operator^ (const Flags< Enum, Storage > &rhs) const
 
Flags< Enum, Storage > operator~ () const
 
 operator bool () const
 
 operator UINT8 () const
 
 operator UINT16 () const
 
 operator UINT32 () const
 

Public Types

typedef Storage InternalType
 

Method documentation

Flags<Enum, Storage>& set ( Enum  value)

Activates all of the provided bits.

void unset ( Enum  value)

Deactivates all of the provided bits.