19 void Resize(
int maxObjects);
25 bool Contains(
int objectIndexA,
int objectIndexB)
const;
27 void Set(
int objectIndexA,
int objectIndexB);
29 bool SetAndReturnDidContain(
int objectIndexA,
int objectIndexB);
33 int CalcBitIndex(
int objectIndexA,
int objectIndexB)
const
35 Eegeo_ASSERT(objectIndexA != objectIndexB);
36 int minIndex = std::min(objectIndexA, objectIndexB);
37 int maxIndex = std::max(objectIndexA, objectIndexB);
39 return (minIndex * (2 * m_maxObjects - minIndex - 3) / 2) + maxIndex - 1;
42 u32 CalcMask(
int bitIndex)
const
44 return 1 << (bitIndex & 31);
47 int CalcElementIndex(
int bitIndex)
const
52 bool IsElementSet(
int elementIndex, u32 elementMask)
const
54 return (m_bitfield[elementIndex] & elementMask) != 0;
57 void SetElement(
int elementIndex, u32 elementMask)
59 m_bitfield[elementIndex] |= elementMask;
63 std::vector<u32> m_bitfield;