gwnavruntime/querysystem/workingmemcontainers/workingmembitfield.h Source File
Go to the documentation of this file.
8 #ifndef Navigation_WorkingMemBitField_H
9 #define Navigation_WorkingMemBitField_H
17 class WorkingMemBitField
22 WorkingMemBitField(WorkingMemory* workingMemory);
24 void Init(WorkingMemory* workingMemory);
27 bool IsInitialized()
const;
35 bool IsBitSet(
KyUInt32 bitIndex)
const;
43 const KyUInt32 wordCount = BitFieldUtils::GetWordsCount(bitCount);
44 KY_FORWARD_ERROR_NO_LOG(m_words.SetMinimumCapacity(wordCount));
46 for(
KyUInt32 i = m_words.GetCount(); i < wordCount; ++i)
47 m_words.PushBack_UnSafe(0);
52 bool IsFull() {
return m_words.IsFull(); }
53 void ReleaseWorkingMemoryBuffer() { m_words.ReleaseWorkingMemoryBuffer(); }
55 KyUInt32* GetWordsBuffer() {
return m_words.GetBuffer(); }
56 const KyUInt32* GetWordsBuffer()
const {
return m_words.GetBuffer(); }
58 WorkingMemArray<KyUInt32> m_words;
61 KY_INLINE WorkingMemBitField::WorkingMemBitField() {}
62 KY_INLINE WorkingMemBitField::WorkingMemBitField(WorkingMemory* workingMemory) : m_words(workingMemory) {}
64 KY_INLINE
void WorkingMemBitField::Init(WorkingMemory* workingMemory) { m_words.Init(workingMemory); }
66 KY_INLINE
bool WorkingMemBitField::IsInitialized()
const {
return m_words.IsInitialized(); }
68 KY_INLINE
KyUInt32 WorkingMemBitField::GetWordCount()
const {
return m_words.GetCount(); }
69 KY_INLINE
KyUInt32 WorkingMemBitField::GetCapacity()
const {
return m_words.GetCapacity(); }
70 KY_INLINE
bool WorkingMemBitField::IsEmpty()
const {
return m_words.IsEmpty(); }
72 KY_INLINE
void WorkingMemBitField::SetBit(
KyUInt32 bitIndex) { BitFieldUtils::SetBit(GetWordsBuffer(), bitIndex); }
73 KY_INLINE
void WorkingMemBitField::UnsetBit(
KyUInt32 bitIndex) { BitFieldUtils::UnsetBit(GetWordsBuffer(), bitIndex); }
74 KY_INLINE
bool WorkingMemBitField::IsBitSet(
KyUInt32 bitIndex)
const {
return BitFieldUtils::IsBitSet(GetWordsBuffer(), bitIndex); }
76 KY_INLINE
void WorkingMemBitField::UnsetAllBits() { memset(GetWordsBuffer(),
'\0', GetWordCount() *
sizeof(
KyUInt32)); }
77 KY_INLINE
void WorkingMemBitField::SetAllBits() { memset(GetWordsBuffer(),
'\xFF', GetWordCount() *
sizeof(
KyUInt32)); }
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Definition: gamekitcrowddispersion.h:20
#define KY_SUCCESS
Shorthand for Kaim::Result::Success.
Definition: types.h:273
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36