Plasma Engine  2.0
Loading...
Searching...
No Matches
Bitfield_inl.h
1#pragma once
2
3template <class Container>
4PL_ALWAYS_INLINE plUInt32 plBitfield<Container>::GetBitInt(plUInt32 uiBitIndex) const
5{
6 return (uiBitIndex >> 5); // div 32
7}
8
9template <class Container>
10PL_ALWAYS_INLINE plUInt32 plBitfield<Container>::GetBitMask(plUInt32 uiBitIndex) const
11{
12 return 1 << (uiBitIndex & 0x1F); // modulo 32, shifted to bit position
13}
14
15template <class Container>
16PL_ALWAYS_INLINE plUInt32 plBitfield<Container>::GetCount() const
17{
18 return m_uiCount;
19}
20
21template <class Container>
22template <typename> // Second template needed so that the compiler only instantiates it when called. Needed to prevent errors with containers that do not support this.
24{
25 const plUInt32 uiInts = (uiBitCount + 31) >> 5;
26 m_Container.SetCountUninitialized(uiInts);
27
28 m_uiCount = uiBitCount;
30
31template <class Container>
32void plBitfield<Container>::SetCount(plUInt32 uiBitCount, bool bSetNew)
33{
34 if (m_uiCount == uiBitCount)
35 return;
36
37 const plUInt32 uiOldBits = m_uiCount;
39 SetCountUninitialized(uiBitCount);
40
41 // if there are new bits, initialize them
42 if (uiBitCount > uiOldBits)
43 {
44 if (bSetNew)
45 SetBitRange(uiOldBits, uiBitCount - uiOldBits);
46 else
47 ClearBitRange(uiOldBits, uiBitCount - uiOldBits);
48 }
49}
51template <class Container>
52PL_ALWAYS_INLINE bool plBitfield<Container>::IsEmpty() const
54 return m_uiCount == 0;
55}
57template <class Container>
58bool plBitfield<Container>::IsAnyBitSet(plUInt32 uiFirstBit /*= 0*/, plUInt32 uiNumBits /*= 0xFFFFFFFF*/) const
60 if (m_uiCount == 0 || uiNumBits == 0)
61 return false;
63 PL_ASSERT_DEBUG(uiFirstBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiFirstBit, m_uiCount);
64
65 const plUInt32 uiLastBit = plMath::Min<plUInt32>(uiFirstBit + uiNumBits, m_uiCount - 1);
66
67 const plUInt32 uiFirstInt = GetBitInt(uiFirstBit);
68 const plUInt32 uiLastInt = GetBitInt(uiLastBit);
69
70 // all within the same int
71 if (uiFirstInt == uiLastInt)
72 {
73 for (plUInt32 i = uiFirstBit; i <= uiLastBit; ++i)
74 {
75 if (IsBitSet(i))
76 return true;
77 }
78 }
79 else
80 {
81 const plUInt32 uiNextIntBit = (uiFirstInt + 1) * 32;
82 const plUInt32 uiPrevIntBit = uiLastInt * 32;
83
84 // check the bits in the first int individually
85 for (plUInt32 i = uiFirstBit; i < uiNextIntBit; ++i)
86 {
87 if (IsBitSet(i))
88 return true;
89 }
90
91 // check the bits in the ints in between with one operation
92 for (plUInt32 i = uiFirstInt + 1; i < uiLastInt; ++i)
93 {
94 if ((m_Container[i] & 0xFFFFFFFF) != 0)
95 return true;
96 }
98 // check the bits in the last int individually
99 for (plUInt32 i = uiPrevIntBit; i <= uiLastBit; ++i)
101 if (IsBitSet(i))
102 return true;
103 }
104 }
105
106 return false;
107}
108
109template <class Container>
110PL_ALWAYS_INLINE bool plBitfield<Container>::IsNoBitSet(plUInt32 uiFirstBit /*= 0*/, plUInt32 uiLastBit /*= 0xFFFFFFFF*/) const
111{
112 return !IsAnyBitSet(uiFirstBit, uiLastBit);
114
115template <class Container>
116bool plBitfield<Container>::AreAllBitsSet(plUInt32 uiFirstBit /*= 0*/, plUInt32 uiNumBits /*= 0xFFFFFFFF*/) const
117{
118 if (m_uiCount == 0 || uiNumBits == 0)
119 return false;
120
121 PL_ASSERT_DEBUG(uiFirstBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiFirstBit, m_uiCount);
122
123 const plUInt32 uiLastBit = plMath::Min<plUInt32>(uiFirstBit + uiNumBits, m_uiCount - 1);
124
125 const plUInt32 uiFirstInt = GetBitInt(uiFirstBit);
126 const plUInt32 uiLastInt = GetBitInt(uiLastBit);
127
128 // all within the same int
129 if (uiFirstInt == uiLastInt)
130 {
131 for (plUInt32 i = uiFirstBit; i <= uiLastBit; ++i)
132 {
133 if (!IsBitSet(i))
134 return false;
135 }
136 }
137 else
138 {
139 const plUInt32 uiNextIntBit = (uiFirstInt + 1) * 32;
140 const plUInt32 uiPrevIntBit = uiLastInt * 32;
141
142 // check the bits in the first int individually
143 for (plUInt32 i = uiFirstBit; i < uiNextIntBit; ++i)
144 {
145 if (!IsBitSet(i))
146 return false;
147 }
148
149 // check the bits in the ints in between with one operation
150 for (plUInt32 i = uiFirstInt + 1; i < uiLastInt; ++i)
151 {
152 if (m_Container[i] != 0xFFFFFFFF)
153 return false;
154 }
155
156 // check the bits in the last int individually
157 for (plUInt32 i = uiPrevIntBit; i <= uiLastBit; ++i)
158 {
159 if (!IsBitSet(i))
160 return false;
161 }
162 }
163
164 return true;
165}
166
167template <class Container>
168PL_ALWAYS_INLINE void plBitfield<Container>::Clear()
169{
170 m_uiCount = 0;
171 m_Container.Clear();
172}
173
174template <class Container>
176{
177 PL_ASSERT_DEBUG(uiBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiBit, m_uiCount);
178
179 m_Container[GetBitInt(uiBit)] |= GetBitMask(uiBit);
180}
181
182template <class Container>
184{
185 PL_ASSERT_DEBUG(uiBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiBit, m_uiCount);
186
187 m_Container[GetBitInt(uiBit)] &= ~GetBitMask(uiBit);
188}
189
190template <class Container>
191PL_ALWAYS_INLINE void plBitfield<Container>::SetBitValue(plUInt32 uiBit, bool bValue)
192{
193 if (bValue)
194 {
195 SetBit(uiBit);
196 }
197 else
198 {
199 ClearBit(uiBit);
200 }
201}
202
203template <class Container>
204bool plBitfield<Container>::IsBitSet(plUInt32 uiBit) const
205{
206 PL_ASSERT_DEBUG(uiBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiBit, m_uiCount);
207
208 return (m_Container[GetBitInt(uiBit)] & GetBitMask(uiBit)) != 0;
209}
210
211template <class Container>
213{
214 for (plUInt32 i = 0; i < m_Container.GetCount(); ++i)
215 m_Container[i] = 0;
216}
217
218template <class Container>
220{
221 for (plUInt32 i = 0; i < m_Container.GetCount(); ++i)
222 m_Container[i] = 0xFFFFFFFF;
223}
224
225template <class Container>
226void plBitfield<Container>::SetBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
227{
228 if (m_uiCount == 0 || uiNumBits == 0)
229 return;
230
231 PL_ASSERT_DEBUG(uiFirstBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiFirstBit, m_uiCount);
232
233 const plUInt32 uiLastBit = uiFirstBit + uiNumBits - 1;
234
235 const plUInt32 uiFirstInt = GetBitInt(uiFirstBit);
236 const plUInt32 uiLastInt = GetBitInt(uiLastBit);
237
238 // all within the same int
239 if (uiFirstInt == uiLastInt)
240 {
241 for (plUInt32 i = uiFirstBit; i <= uiLastBit; ++i)
242 SetBit(i);
243
244 return;
245 }
246
247 const plUInt32 uiNextIntBit = (uiFirstInt + 1) * 32;
248 const plUInt32 uiPrevIntBit = uiLastInt * 32;
249
250 // set the bits in the first int individually
251 for (plUInt32 i = uiFirstBit; i < uiNextIntBit; ++i)
252 SetBit(i);
253
254 // set the bits in the ints in between with one operation
255 for (plUInt32 i = uiFirstInt + 1; i < uiLastInt; ++i)
256 m_Container[i] = 0xFFFFFFFF;
257
258 // set the bits in the last int individually
259 for (plUInt32 i = uiPrevIntBit; i <= uiLastBit; ++i)
260 SetBit(i);
261}
262
263template <class Container>
264void plBitfield<Container>::ClearBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
265{
266 if (m_uiCount == 0 || uiNumBits == 0)
267 return;
268
269 PL_ASSERT_DEBUG(uiFirstBit < m_uiCount, "Cannot access bit {0}, the bitfield only has {1} bits.", uiFirstBit, m_uiCount);
270
271 const plUInt32 uiLastBit = uiFirstBit + uiNumBits - 1;
272
273 const plUInt32 uiFirstInt = GetBitInt(uiFirstBit);
274 const plUInt32 uiLastInt = GetBitInt(uiLastBit);
275
276 // all within the same int
277 if (uiFirstInt == uiLastInt)
278 {
279 for (plUInt32 i = uiFirstBit; i <= uiLastBit; ++i)
280 ClearBit(i);
281
282 return;
283 }
284
285 const plUInt32 uiNextIntBit = (uiFirstInt + 1) * 32;
286 const plUInt32 uiPrevIntBit = uiLastInt * 32;
287
288 // set the bits in the first int individually
289 for (plUInt32 i = uiFirstBit; i < uiNextIntBit; ++i)
290 ClearBit(i);
291
292 // set the bits in the ints in between with one operation
293 for (plUInt32 i = uiFirstInt + 1; i < uiLastInt; ++i)
294 m_Container[i] = 0;
295
296 // set the bits in the last int individually
297 for (plUInt32 i = uiPrevIntBit; i <= uiLastBit; ++i)
298 ClearBit(i);
299}
300
301template <class Container>
303{
304 plMath::Swap(m_uiCount, other.m_uiCount);
305 m_Container.Swap(other.m_Container);
306}
307
308template <class Container>
310{
311 return ConstIterator(*this);
312};
313
314template <class Container>
316{
317 return ConstIterator();
318};
319
321// plBitfield<Container>::ConstIterator
322
323template <class Container>
325{
326 m_pBitfield = &bitfield;
327 FindNextChunk(0);
328}
329
330template <class Container>
332{
333 return m_pBitfield != nullptr;
334}
335
336template <class Container>
337PL_ALWAYS_INLINE plUInt32 plBitfield<Container>::ConstIterator::Value() const
338{
339 return *m_Iterator + (m_uiChunk << 5);
340}
341
342template <class Container>
344{
345 ++m_Iterator;
346 if (!m_Iterator.IsValid())
347 {
348 FindNextChunk(m_uiChunk + 1);
349 }
350}
351
352template <class Container>
353PL_ALWAYS_INLINE bool plBitfield<Container>::ConstIterator::operator==(const ConstIterator& other) const
354{
355 return m_pBitfield == other.m_pBitfield && m_Iterator == other.m_Iterator && m_uiChunk == other.m_uiChunk;
356}
357
358template <class Container>
359PL_ALWAYS_INLINE bool plBitfield<Container>::ConstIterator::operator!=(const ConstIterator& other) const
360{
361 return m_pBitfield != other.m_pBitfield || m_Iterator != other.m_Iterator || m_uiChunk != other.m_uiChunk;
362}
363
364template <class Container>
365PL_ALWAYS_INLINE plUInt32 plBitfield<Container>::ConstIterator::operator*() const
366{
367 return Value();
368}
369
370template <class Container>
372{
373 Next();
374}
375
376template <class Container>
378{
379 if (uiStartChunk < m_pBitfield->m_Container.GetCount())
380 {
381 const plUInt32 uiLastChunk = m_pBitfield->m_Container.GetCount() - 1;
382 for (plUInt32 i = uiStartChunk; i < uiLastChunk; ++i)
383 {
384 if (m_pBitfield->m_Container[i] != 0)
385 {
386 m_uiChunk = i;
387 m_Iterator = sub_iterator(m_pBitfield->m_Container[i]);
388 return;
389 }
390 }
391
392 const plUInt32 uiMask = 0xFFFFFFFF >> (32 - (m_pBitfield->m_uiCount - (uiLastChunk << 5)));
393 if ((m_pBitfield->m_Container[uiLastChunk] & uiMask) != 0)
394 {
395 m_uiChunk = uiLastChunk;
396 m_Iterator = sub_iterator(m_pBitfield->m_Container[uiLastChunk] & uiMask);
397 return;
398 }
399 }
400
401 // End iterator.
402 m_pBitfield = nullptr;
403 m_uiChunk = 0;
404 m_Iterator = sub_iterator();
405}
406
410
411template <typename T>
413{
414 static_assert(std::is_unsigned<T>::value, "Storage type must be unsigned");
415}
416
417template <typename T>
418PL_ALWAYS_INLINE plStaticBitfield<T> plStaticBitfield<T>::MakeFromMask(StorageType bits)
419{
420 return plStaticBitfield<T>(bits);
421}
422
423template <typename T>
424PL_ALWAYS_INLINE bool plStaticBitfield<T>::IsAnyBitSet() const
425{
426 return m_Storage != 0;
427}
428
429template <typename T>
430PL_ALWAYS_INLINE bool plStaticBitfield<T>::IsNoBitSet() const
431{
432 return m_Storage == 0;
433}
434
435template <typename T>
437{
438 const T inv = ~m_Storage;
439 return inv == 0;
440}
441
442template <typename T>
443void plStaticBitfield<T>::ClearBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
444{
445 PL_ASSERT_DEBUG(uiFirstBit < GetStorageTypeBitCount(), "Cannot access first bit {0}, the bitfield only has {1} bits.", uiFirstBit, GetStorageTypeBitCount());
446
447 T mask = (uiNumBits / 8 >= sizeof(T)) ? (~static_cast<T>(0)) : ((static_cast<T>(1) << uiNumBits) - 1);
448 mask <<= uiFirstBit;
449 mask = ~mask;
450 m_Storage &= mask;
451}
452
453template <typename T>
454void plStaticBitfield<T>::SetBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
455{
456 PL_ASSERT_DEBUG(uiFirstBit < GetStorageTypeBitCount(), "Cannot access first bit {0}, the bitfield only has {1} bits.", uiFirstBit, GetStorageTypeBitCount());
457
458 T mask = (uiNumBits / 8 >= sizeof(T)) ? (~static_cast<T>(0)) : ((static_cast<T>(1) << uiNumBits) - 1);
459 mask <<= uiFirstBit;
460 m_Storage |= mask;
461}
462
463template <typename T>
464PL_ALWAYS_INLINE plUInt32 plStaticBitfield<T>::GetNumBitsSet() const
465{
466 return plMath::CountBits(m_Storage);
467}
468
469template <typename T>
470PL_ALWAYS_INLINE plUInt32 plStaticBitfield<T>::GetHighestBitSet() const
471{
472 return m_Storage == 0 ? GetStorageTypeBitCount() : plMath::FirstBitHigh(m_Storage);
473}
474
475template <typename T>
476PL_ALWAYS_INLINE plUInt32 plStaticBitfield<T>::GetLowestBitSet() const
477{
478 return m_Storage == 0 ? GetStorageTypeBitCount() : plMath::FirstBitLow(m_Storage);
479}
480
481template <typename T>
482PL_ALWAYS_INLINE void plStaticBitfield<T>::SetAllBits()
483{
484 m_Storage = plMath::MaxValue<T>(); // possible because we assert that T is unsigned
485}
486
487template <typename T>
489{
490 m_Storage = 0;
491}
492
493template <typename T>
494PL_ALWAYS_INLINE bool plStaticBitfield<T>::IsBitSet(plUInt32 uiBit) const
495{
496 PL_ASSERT_DEBUG(uiBit < GetStorageTypeBitCount(), "Cannot access bit {0}, the bitfield only has {1} bits.", uiBit, GetStorageTypeBitCount());
497
498 return (m_Storage & (static_cast<T>(1u) << uiBit)) != 0;
499}
500
501template <typename T>
502PL_ALWAYS_INLINE void plStaticBitfield<T>::ClearBit(plUInt32 uiBit)
503{
504 PL_ASSERT_DEBUG(uiBit < GetStorageTypeBitCount(), "Cannot access bit {0}, the bitfield only has {1} bits.", uiBit, GetStorageTypeBitCount());
505
506 m_Storage &= ~(static_cast<T>(1u) << uiBit);
507}
508
509template <typename T>
510PL_ALWAYS_INLINE void plStaticBitfield<T>::SetBitValue(plUInt32 uiBit, bool bValue)
511{
512 if (bValue)
513 {
514 SetBit(uiBit);
515 }
516 else
517 {
518 ClearBit(uiBit);
519 }
520}
521
522template <typename T>
523PL_ALWAYS_INLINE void plStaticBitfield<T>::SetBit(plUInt32 uiBit)
524{
525 PL_ASSERT_DEBUG(uiBit < GetStorageTypeBitCount(), "Cannot access bit {0}, the bitfield only has {1} bits.", uiBit, GetStorageTypeBitCount());
526
527 m_Storage |= static_cast<T>(1u) << uiBit;
528}
529
530template <typename T>
531PL_ALWAYS_INLINE void plStaticBitfield<T>::SetValue(T value)
532{
533 m_Storage = value;
534}
535
536template <typename T>
537PL_ALWAYS_INLINE T plStaticBitfield<T>::GetValue() const
538{
539 return m_Storage;
540}
541
542template <typename T>
544{
545 plMath::Swap(m_Storage, other.m_Storage);
546}
A template interface, that turns any array class into a bitfield.
Definition Bitfield.h:17
bool IsEmpty() const
Returns true, if the bitfield does not store any bits.
Definition Bitfield_inl.h:52
void SetBitValue(plUInt32 uiBit, bool bValue)
Sets the given bit to 1 or 0 depending on the given value.
Definition Bitfield_inl.h:191
void SetCount(plUInt32 uiBitCount, bool bSetNew=false)
Resizes the Bitfield to hold the given number of bits. If bSetNew is true, new bits are set to 1,...
Definition Bitfield_inl.h:32
bool IsNoBitSet(plUInt32 uiFirstBit=0, plUInt32 uiNumBits=0xFFFFFFFF) const
Returns true, if the bitfield is empty or all bits are set to zero.
Definition Bitfield_inl.h:110
void ClearBit(plUInt32 uiBit)
Clears the given bit to 0.
Definition Bitfield_inl.h:183
ConstIterator GetIterator() const
Returns a constant iterator to the very first set bit. Note that due to the way iterating through bit...
Definition Bitfield_inl.h:309
bool IsBitSet(plUInt32 uiBit) const
Returns true, if the given bit is set to 1.
Definition Bitfield_inl.h:204
plUInt32 GetCount() const
Returns the number of bits that this bitfield stores.
Definition Bitfield_inl.h:16
void SetCountUninitialized(plUInt32 uiBitCount)
Resizes the Bitfield to hold the given number of bits. This version does NOT initialize new bits!
Definition Bitfield_inl.h:23
bool AreAllBitsSet(plUInt32 uiFirstBit=0, plUInt32 uiNumBits=0xFFFFFFFF) const
Returns true, if the bitfield is not empty and all bits are set to one.
Definition Bitfield_inl.h:116
void ClearBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
Clears the range starting at uiFirstBit up to (and including) uiLastBit to 0.
Definition Bitfield_inl.h:264
void SetBit(plUInt32 uiBit)
Sets the given bit to 1.
Definition Bitfield_inl.h:175
void SetBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
Sets the range starting at uiFirstBit up to (and including) uiLastBit to 1.
Definition Bitfield_inl.h:226
void Clear()
Discards all bits and sets count to zero.
Definition Bitfield_inl.h:168
void SetAllBits()
Sets all bits to 1.
Definition Bitfield_inl.h:219
ConstIterator GetEndIterator() const
Returns an invalid iterator. Needed to support range based for loops.
Definition Bitfield_inl.h:315
void Swap(plBitfield< Container > &other)
Swaps two bitfields.
Definition Bitfield_inl.h:302
void ClearAllBits()
Clears all bits to 0.
Definition Bitfield_inl.h:212
bool IsAnyBitSet(plUInt32 uiFirstBit=0, plUInt32 uiNumBits=0xFFFFFFFF) const
Returns true, if the bitfield is not empty and any bit is 1.
Definition Bitfield_inl.h:58
Definition Bitfield.h:167
void Swap(plStaticBitfield< T > &other)
Swaps two bitfields.
Definition Bitfield_inl.h:543
plUInt32 GetLowestBitSet() const
Returns the index of the lowest bit that is set. Returns the max index+1 in case no bit is set,...
Definition Bitfield_inl.h:476
bool IsBitSet(plUInt32 uiBit) const
Returns true, if the given bit is set to 1.
Definition Bitfield_inl.h:494
void ClearBit(plUInt32 uiBit)
Clears the given bit to 0.
Definition Bitfield_inl.h:502
bool IsAnyBitSet() const
Returns true, if the bitfield is not zero.
Definition Bitfield_inl.h:424
void ClearBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
Clears the range starting at uiFirstBit up to (and including) uiLastBit to 0.
Definition Bitfield_inl.h:443
bool AreAllBitsSet() const
Returns true, if the bitfield is not empty and all bits are set to one.
Definition Bitfield_inl.h:436
void SetAllBits()
Sets all bits to 1.
Definition Bitfield_inl.h:482
void SetValue(T value)
Sets the raw uint that stores all bits.
Definition Bitfield_inl.h:531
plStaticBitfield()
Initializes the bitfield to all zero.
Definition Bitfield_inl.h:412
bool IsNoBitSet() const
Returns true, if the bitfield is all zero.
Definition Bitfield_inl.h:430
plUInt32 GetNumBitsSet() const
Returns the count of how many bits are set in total.
Definition Bitfield_inl.h:464
void ClearAllBits()
Clears all bits to 0. Same as Clear().
Definition Bitfield_inl.h:488
T GetValue() const
Returns the raw uint that stores all bits.
Definition Bitfield_inl.h:537
void SetBitValue(plUInt32 uiBit, bool bValue)
Sets the given bit to 1 or 0 depending on the given value.
Definition Bitfield_inl.h:510
void SetBitRange(plUInt32 uiFirstBit, plUInt32 uiNumBits)
Sets the range starting at uiFirstBit up to (and including) uiLastBit to 1.
Definition Bitfield_inl.h:454
void SetBit(plUInt32 uiBit)
Sets the given bit to 1.
Definition Bitfield_inl.h:523
plUInt32 GetHighestBitSet() const
Returns the index of the highest bit that is set. Returns the max index+1 in case no bit is set,...
Definition Bitfield_inl.h:470
constexpr PL_ALWAYS_INLINE T Min(T f1, T f2)
Returns the smaller value, f1 or f2.
Definition Math_inl.h:27
PL_ALWAYS_INLINE plUInt32 FirstBitHigh(plUInt32 value)
Returns the index of the most significant bit set.
Definition Math_inl.h:119
constexpr TYPE MaxValue()
Returns the largest possible positive value (that is not infinity).
PL_ALWAYS_INLINE plUInt32 FirstBitLow(plUInt32 value)
Returns the index of the least significant bit set.
Definition Math_inl.h:70
PL_ALWAYS_INLINE plUInt32 CountBits(plUInt32 value)
Returns the number of bits set.
Definition Math_inl.h:186
PL_ALWAYS_INLINE void Swap(T &ref_f1, T &ref_f2)
Swaps the values in the two variables f1 and f2.
Definition Math_inl.h:224
Definition Bitfield.h:73
void operator++()
Shorthand for 'Next'.
Definition Bitfield_inl.h:371
plUInt32 Value() const
Returns the 'value' of the element that this iterator points to.
Definition Bitfield_inl.h:337
bool IsValid() const
Checks whether this iterator points to a valid element.
Definition Bitfield_inl.h:331
plUInt32 operator*() const
Returns 'Value()' to enable foreach.
Definition Bitfield_inl.h:365
void Next()
Advances the iterator to the next element in the map. The iterator will not be valid anymore,...
Definition Bitfield_inl.h:343