MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / Set

Method Set

Include/XnBitSet.h:45–55  ·  view source on GitHub ↗

Sets the bit at nIndex to bValue. **/

Source from the content-addressed store, hash-verified

43
44 /** Sets the bit at nIndex to bValue. **/
45 XnStatus Set(XnUInt32 nIndex, XnBool bValue)
46 {
47 XnUInt32 nArrayIndex = (nIndex >> 5);
48 XnUInt32 nMask = (1 << ((~nIndex) & 0x1F));
49 XnUInt32 nOldVal = nArrayIndex < m_array.GetSize() ? m_array[nArrayIndex] : 0;
50 XnUInt32 nNewVal = bValue ? (nOldVal | nMask) : (nOldVal & (~nMask));
51 XnStatus nRetVal = m_array.Set(nArrayIndex, nNewVal, 0);
52 XN_IS_STATUS_OK(nRetVal);
53 m_nSize = XN_MAX(m_nSize, nIndex + 1);
54 return XN_STATUS_OK;
55 }
56
57 /** @returns the value of the bit specified by nIndex. **/
58 XnBool IsSet(XnUInt32 nIndex) const

Callers

nothing calls this directly

Calls 1

GetSizeMethod · 0.45

Tested by

no test coverage detected