Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
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 bool operator< (const Mask< EnumType > &other) const
 
constexpr bool operator> (const Mask< EnumType > &other) const
 
constexpr bool operator>= (const Mask< EnumType > &other) const
 
constexpr bool operator<= (const Mask< EnumType > &other) const
 
constexpr bool operator== (const Mask< EnumType > &other) const
 
constexpr bool operator!= (const Mask< EnumType > &other) const
 
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 83 of file mask.h.

83{ return !mask_; }

◆ operator!=()

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

Definition at line 77 of file mask.h.

77 {
78 return mask_ != other.mask_;
79 }

◆ operator&()

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

Definition at line 87 of file mask.h.

87 {
88 return Mask<EnumType>{mask_ & other.mask_};
89 }

◆ operator&=()

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

Definition at line 112 of file mask.h.

112 {
113 mask_ &= other.mask_;
114 return *this;
115 }

◆ operator<()

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

Definition at line 57 of file mask.h.

57 {
58 return mask_ < other.mask_;
59 }

◆ operator<=()

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

Definition at line 69 of file mask.h.

69 {
70 return mask_ <= other.mask_;
71 }

◆ 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 bool impeller::Mask< EnumType_ >::operator== ( const Mask< EnumType > &  other) const
inlineconstexpr

Definition at line 73 of file mask.h.

73 {
74 return mask_ == other.mask_;
75 }

◆ operator>()

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

Definition at line 61 of file mask.h.

61 {
62 return mask_ > other.mask_;
63 }

◆ operator>=()

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

Definition at line 65 of file mask.h.

65 {
66 return mask_ >= other.mask_;
67 }

◆ operator^()

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

Definition at line 95 of file mask.h.

95 {
96 return Mask<EnumType>{mask_ ^ other.mask_};
97 }

◆ operator^=()

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

Definition at line 117 of file mask.h.

117 {
118 mask_ ^= other.mask_;
119 return *this;
120 }

◆ operator|()

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

Definition at line 91 of file mask.h.

91 {
92 return Mask<EnumType>{mask_ | other.mask_};
93 }

◆ operator|=()

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

Definition at line 107 of file mask.h.

107 {
108 mask_ |= other.mask_;
109 return *this;
110 }

◆ operator~()

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

Definition at line 99 of file mask.h.

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

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