 |
OpenNI 1.5.7
|
Go to the documentation of this file.
51 XnArray(
const XnArray& other) : m_pData(NULL), m_nSize(0), m_nAllocatedSize(0)
86 for (XnUInt32 i = 0; i < nSize; i++)
88 m_pData[i] = pData[i];
109 if (nReservedSize > m_nAllocatedSize)
113 nReservedSize = (nReservedSize >> 1) | nReservedSize;
114 nReservedSize = (nReservedSize >> 2) | nReservedSize;
115 nReservedSize = (nReservedSize >> 4) | nReservedSize;
116 nReservedSize = (nReservedSize >> 8) | nReservedSize;
117 nReservedSize = (nReservedSize >> 16) | nReservedSize;
125 for (XnUInt32 i = 0; i < m_nSize; i++)
127 pNewData[i] = m_pData[i];
135 m_nAllocatedSize = nReservedSize;
143 return (m_nSize == 0);
197 for (XnUInt32 i = m_nSize; i < nSize; i++)
199 m_pData[i] = fillVal;
211 return m_nAllocatedSize;
221 m_pData[nIndex] = val;
226 XnStatus Set(XnUInt32 nIndex,
const T& val,
const T& fillVal)
230 m_pData[nIndex] = val;
237 return Set(m_nSize, val);
247 for (XnUInt32 i = 0; i < nCount; ++i)
249 m_pData[nOffset + i] = aValues[i];
264 XN_ASSERT(nIndex < m_nSize);
265 return m_pData[nIndex];
271 XN_ASSERT(nIndex < m_nSize);
272 return m_pData[nIndex];
290 return m_pData + m_nSize;
296 return m_pData + m_nSize;
300 void Init(XnUInt32 nBaseSize =
BASE_SIZE)
303 m_nAllocatedSize = nBaseSize;
309 XnUInt32 m_nAllocatedSize;
312 #endif // __XNARRAY_H__
XnStatus Set(XnUInt32 nIndex, const T &val)
Definition: XnArray.h:236
T * Iterator
Definition: XnArray.h:58
XnStatus CopyFrom(const XnArray &other)
Definition: XnArray.h:89
XnArray & operator=(const XnArray &other)
Definition: XnArray.h:82
#define XN_VALIDATE_ALLOC_PTR(x)
Definition: XnOS.h:131
#define XN_IS_STATUS_OK(x)
Definition: XnMacros.h:59
#define XN_STATUS_OK
Definition: XnStatus.h:36
XnStatus SetSize(XnUInt32 nSize)
Definition: XnArray.h:173
XnStatus Reserve(XnUInt32 nReservedSize)
Definition: XnArray.h:126
XnUInt32 XnStatus
Definition: XnStatus.h:33
void Clear()
Definition: XnArray.h:274
XnStatus SetMinSize(XnUInt32 nSize)
Definition: XnArray.h:196
XnUInt32 GetSize() const
Definition: XnArray.h:166
T & operator[](XnUInt32 nIndex)
Definition: XnArray.h:281
@ BASE_SIZE
Definition: XnArray.h:74
#define XN_DELETE_ARR(p)
Definition: XnOS.h:340
const T * GetData() const
Definition: XnArray.h:113
#define XN_VALIDATE_INPUT_PTR(x)
Definition: XnOS.h:126
XnArray(XnUInt32 nBaseSize=BASE_SIZE)
Definition: XnArray.h:64
XnBool IsEmpty() const
Definition: XnArray.h:160
XnStatus AddLast(const T &val)
Definition: XnArray.h:254
Iterator begin()
Definition: XnArray.h:295
#define XN_NEW_ARR(type, count)
Definition: XnOS.h:338
virtual ~XnArray()
Definition: XnArray.h:76
Iterator end()
Definition: XnArray.h:307
XnStatus SetData(const T *pData, XnUInt32 nSize)
Definition: XnArray.h:100
const typedef T * ConstIterator
Definition: XnArray.h:61
XnUInt32 GetAllocatedSize() const
Definition: XnArray.h:228