Flutter Engine
 
Loading...
Searching...
No Matches
impeller::Mask< EnumType_ > Struct Template Reference

A mask of typed enums. More...

#include <mask.h>

Public Types

using EnumType = EnumType_
 
using MaskType = typename std::underlying_type< EnumType >::type
 

Public Member Functions

constexpr Mask ()=default
 
constexpr Mask (const Mask< EnumType > &other)=default
 
constexpr Mask (Mask< EnumType > &&other)=default
 
constexpr Mask (EnumType type)
 
constexpr Mask (MaskType mask)
 
constexpr operator MaskType () const
 
constexpr operator bool () const
 
constexpr auto operator<=> (const Mask< EnumType > &other) const =default
 
constexpr bool operator! () const
 
constexpr Mask< EnumTypeoperator& (const Mask< EnumType > &other) const
 
constexpr Mask< EnumTypeoperator| (const Mask< EnumType > &other) const
 
constexpr Mask< EnumTypeoperator^ (const Mask< EnumType > &other) const
 
constexpr Mask< EnumTypeoperator~ () const
 
constexpr Mask< EnumType > & operator= (const Mask< EnumType > &)=default
 
constexpr Mask< EnumType > & operator= (Mask< EnumType > &&)=default
 
constexpr Mask< EnumType > & operator|= (const Mask< EnumType > &other)
 
constexpr Mask< EnumType > & operator&= (const Mask< EnumType > &other)
 
constexpr Mask< EnumType > & operator^= (const Mask< EnumType > &other)
 

Detailed Description

template<typename EnumType_>
struct impeller::Mask< EnumType_ >

A mask of typed enums.

Template Parameters
EnumType_The type of the enum. Must be an enum class.

Definition at line 33 of file mask.h.

Member Typedef Documentation

◆ EnumType

template<typename EnumType_ >
using impeller::Mask< EnumType_ >::EnumType = EnumType_

Definition at line 34 of file mask.h.

◆ MaskType

template<typename EnumType_ >
using impeller::Mask< EnumType_ >::MaskType = typename std::underlying_type<EnumType>::type

Definition at line 35 of file mask.h.

Constructor & Destructor Documentation

◆ Mask() [1/5]

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::Mask ( )
constexprdefault

◆ Mask() [2/5]

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::Mask ( const Mask< EnumType > &  other)
constexprdefault

◆ Mask() [3/5]

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::Mask ( Mask< EnumType > &&  other)
constexprdefault

◆ Mask() [4/5]

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::Mask ( EnumType  type)
inlineconstexpr

Definition at line 43 of file mask.h.

44 : mask_(static_cast<MaskType>(type)) {}
GLenum type
typename std::underlying_type< EnumType >::type MaskType
Definition mask.h:35

◆ Mask() [5/5]

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::Mask ( MaskType  mask)
inlineexplicitconstexpr

Definition at line 46 of file mask.h.

46: mask_(static_cast<MaskType>(mask)) {}

Member Function Documentation

◆ operator bool()

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::operator bool ( ) const
inlineexplicitconstexpr

Definition at line 52 of file mask.h.

52{ return !!mask_; }

◆ operator MaskType()

template<typename EnumType_ >
constexpr impeller::Mask< EnumType_ >::operator MaskType ( ) const
inlineexplicitconstexpr

Definition at line 50 of file mask.h.

50{ return mask_; }

◆ operator!()

template<typename EnumType_ >
constexpr bool impeller::Mask< EnumType_ >::operator! ( ) const
inlineconstexpr

Definition at line 60 of file mask.h.

60{ return !mask_; }

◆ operator&()

template<typename EnumType_ >
constexpr Mask< EnumType > impeller::Mask< EnumType_ >::operator& ( const Mask< EnumType > &  other) const
inlineconstexpr

Definition at line 64 of file mask.h.

64 {
65 return Mask<EnumType>{mask_ & other.mask_};
66 }

◆ operator&=()

template<typename EnumType_ >
constexpr Mask< EnumType > & impeller::Mask< EnumType_ >::operator&= ( const Mask< EnumType > &  other)
inlineconstexpr

Definition at line 89 of file mask.h.

89 {
90 mask_ &= other.mask_;
91 return *this;
92 }

◆ operator<=>()

template<typename EnumType_ >
constexpr auto impeller::Mask< EnumType_ >::operator<=> ( const Mask< EnumType > &  other) const
constexprdefault

◆ operator=() [1/2]

template<typename EnumType_ >
constexpr Mask< EnumType > & impeller::Mask< EnumType_ >::operator= ( const Mask< EnumType > &  )
constexprdefault

◆ operator=() [2/2]

template<typename EnumType_ >
constexpr Mask< EnumType > & impeller::Mask< EnumType_ >::operator= ( Mask< EnumType > &&  )
constexprdefault

◆ operator^()

template<typename EnumType_ >
constexpr Mask< EnumType > impeller::Mask< EnumType_ >::operator^ ( const Mask< EnumType > &  other) const
inlineconstexpr

Definition at line 72 of file mask.h.

72 {
73 return Mask<EnumType>{mask_ ^ other.mask_};
74 }

◆ operator^=()

template<typename EnumType_ >
constexpr Mask< EnumType > & impeller::Mask< EnumType_ >::operator^= ( const Mask< EnumType > &  other)
inlineconstexpr

Definition at line 94 of file mask.h.

94 {
95 mask_ ^= other.mask_;
96 return *this;
97 }

◆ operator|()

template<typename EnumType_ >
constexpr Mask< EnumType > impeller::Mask< EnumType_ >::operator| ( const Mask< EnumType > &  other) const
inlineconstexpr

Definition at line 68 of file mask.h.

68 {
69 return Mask<EnumType>{mask_ | other.mask_};
70 }

◆ operator|=()

template<typename EnumType_ >
constexpr Mask< EnumType > & impeller::Mask< EnumType_ >::operator|= ( const Mask< EnumType > &  other)
inlineconstexpr

Definition at line 84 of file mask.h.

84 {
85 mask_ |= other.mask_;
86 return *this;
87 }

◆ operator~()

template<typename EnumType_ >
constexpr Mask< EnumType > impeller::Mask< EnumType_ >::operator~ ( ) const
inlineconstexpr

Definition at line 76 of file mask.h.

76{ return Mask<EnumType>{~mask_}; }

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