8template<
typename Value,
typename Input>
13template<
typename Value,
typename Input>
15 TBitFlags(static_cast<Input>(collectFlags(flagsSet)))
18template<
typename Value,
typename Input>
20 m_bits(static_cast<Value>(flagsSet))
23template<
typename Value,
typename Input>
24template<
typename OtherInput>
26 m_bits(otherFlags.get())
29template<
typename Value,
typename Input>
33 flags.m_bits = collectFlags(flagsSet);
34 return unionWith(flags);
37template<
typename Value,
typename Input>
40 m_bits |= flags.m_bits;
45template<
typename Value,
typename Input>
48 m_bits &= collectFlags(flagsSet);
53template<
typename Value,
typename Input>
56 return set(
static_cast<Input
>(collectFlags(flagsSet)));
59template<
typename Value,
typename Input>
62 m_bits =
static_cast<Value
>(flagsSet);
66template<
typename Value,
typename Input>
69 return unionWith(flagsSet);
72template<
typename Value,
typename Input>
75 m_bits &= ~(collectFlags(flagsSet));
80template<
typename Value,
typename Input>
83 return hasNone(
static_cast<Input
>(collectFlags(flagsSet)));
86template<
typename Value,
typename Input>
89 return hasAny(
static_cast<Input
>(collectFlags(flagsSet)));
92template<
typename Value,
typename Input>
95 return hasAll(
static_cast<Input
>(collectFlags(flagsSet)));
98template<
typename Value,
typename Input>
101 return hasExactly(
static_cast<Input
>(collectFlags(flagsSet)));
104template<
typename Value,
typename Input>
107 const auto flagsValue =
static_cast<Value
>(flagsSet);
108 return (m_bits & flagsValue) == 0;
111template<
typename Value,
typename Input>
114 const auto flagsValue =
static_cast<Value
>(flagsSet);
115 return (m_bits & flagsValue) != 0;
118template<
typename Value,
typename Input>
121 const auto flagsValue =
static_cast<Value
>(flagsSet);
122 return (m_bits & flagsValue) == flagsValue;
125template<
typename Value,
typename Input>
128 const auto flagsValue =
static_cast<Value
>(flagsSet);
129 return m_bits == flagsValue;
132template<
typename Value,
typename Input>
135 return hasAll(singleFlag);
138template<
typename Value,
typename Input>
141 return hasNone(singleFlag);
144template<
typename Value,
typename Input>
150template<
typename Value,
typename Input>
153 return m_bits == other.m_bits;
156template<
typename Value,
typename Input>
162template<
typename Value,
typename Input>
165 Value inputFlags = 0;
166 for(
const Input& flag : flagsSet)
168 inputFlags |=
static_cast<Value
>(flag);
Manipulate a value type where each bit is a binary flag.
Definition TBitFlags.h:17
constexpr bool hasExactly(const FlagsSet &flagsSet) const
Checks whether this instance contains exactly the specified flags. No more, no less.
Definition TBitFlags.ipp:99
constexpr bool has(Input singleFlag) const
Checks whether this single flag is fully contained.
Definition TBitFlags.ipp:133
constexpr bool isEmpty() const
Checks whether this instance contains no flags.
Definition TBitFlags.ipp:145
constexpr TBitFlags & set(const FlagsSet &flagsSet)
Definition TBitFlags.ipp:54
constexpr TBitFlags & intersectWith(const FlagsSet &flagsSet)
Intersects this instance with the specified flags.
Definition TBitFlags.ipp:46
constexpr TBitFlags & turnOff(const FlagsSet &flagsSet)
Definition TBitFlags.ipp:73
constexpr bool hasAny(const FlagsSet &flagsSet) const
Checks whether this instance contains at least one of the specified flags.
Definition TBitFlags.ipp:87
constexpr bool hasNo(Input singleFlag) const
Checks whether this single flag is fully absent.
Definition TBitFlags.ipp:139
constexpr bool hasNone(const FlagsSet &flagsSet) const
Checks whether this instance contains no specified flags.
Definition TBitFlags.ipp:81
constexpr TBitFlags()
Creates an instance with no flags.
Definition TBitFlags.ipp:9
constexpr Value get() const
Get the value representing current flags.
Definition TBitFlags.ipp:157
constexpr bool hasAll(const FlagsSet &flagsSet) const
Checks whether this instance contains all of the specified flags.
Definition TBitFlags.ipp:93
constexpr TBitFlags & turnOn(const FlagsSet &flagsSet)
Enable/disable specified flags.
Definition TBitFlags.ipp:67
constexpr TBitFlags & unionWith(const FlagsSet &flagsSet)
Unions specified flags into this instance.
Definition TBitFlags.ipp:30
constexpr bool isEqual(const TBitFlags &other) const
Definition TBitFlags.ipp:151
The root for all renderer implementations.
Definition EEngineProject.h:6