12inline void*
operator new (
size_t size,
void*
ptr)
noexcept {
return ptr; }
13inline void operator delete (
void*
ptr,
void* voidptr2)
noexcept { }
31#if (_AFX_PACKING >= 8)
37 _In_ size_t MaxElements,
38 _In_ size_t ElementSize
89 _In_ size_t NumElements)
91 for (
size_t i = 0;
i < NumElements;
i++)
100 _In_ size_t NumElements)
106#if defined(__GNUC__) && __GNUC__ >= 8
107 #pragma GCC diagnostic push
108 #pragma GCC diagnostic ignored "-Wclass-memaccess"
111#if defined(__GNUC__) && __GNUC__ >= 8
112 #pragma GCC diagnostic pop
125 return (Val1 == Val2);
136 else if (Val1 > Val2)
160template<
typename T,
class Allocator = CCRTAllocator>
171template<
typename E,
class ETraits = CElementTraits<E> >
185#pragma push_macro("new")
190 for (
size_t n = 0;
n <
Size; ++
n)
196#pragma pop_macro("new")
200 for (
size_t n = 0;
n <
Size; ++
n)
212 if (allocSize < nNewSize)
213 allocSize = nNewSize;
255 bool SetCount(
size_t nNewSize,
int nGrowBy = - 1);
261 E&
GetAt(
size_t iElement);
262 const E&
GetAt(
size_t iElement)
const;
275template<
typename E,
class ETraits>
284template<
typename E,
class ETraits>
291#pragma push_macro("new")
294template<
typename E,
class ETraits>
297 if (m_Size >= m_AllocatedSize)
299 if (!GrowAllocatedData(m_Size + 1))
311#pragma pop_macro("new")
313template<
typename E,
class ETraits>
316 if (!SetCount(m_Size + 1))
324template<
typename E,
class ETraits>
330 m_GrowBy = (
size_t)nGrowBy;
333 if (nNewSize == m_Size)
337 else if (nNewSize == 0)
341 DestructItems(m_pData, m_Size);
344 m_Size = m_AllocatedSize =
NULL;
346 else if (nNewSize < m_AllocatedSize)
348 if (nNewSize > m_Size)
350 CreateItems(m_pData + m_Size, nNewSize - m_Size);
354 DestructItems(m_pData + nNewSize, m_Size - nNewSize);
360 if (!GrowAllocatedData(nNewSize))
365 CreateItems(m_pData + m_Size, nNewSize - m_Size);
372template<
typename E,
class ETraits>
378template<
typename E,
class ETraits>
383 return m_pData[iElement];
386template<
typename E,
class ETraits>
391 return m_pData[iElement];
394template<
typename E,
class ETraits>
399 return m_pData[iElement];
402template<
typename E,
class ETraits>
407 return m_pData[iElement];
410template<
typename E,
class ETraits>
416template<
typename E,
class ETraits>
423template<
typename E,
class ETraits = CElementTraits<E> >
523template<
typename E,
class ETraits>
526 m_BlockSize(nBlockSize),
535template<
typename E,
class ETraits>
541template<
typename E,
class ETraits>
544 return m_NumElements;
547template<
typename E,
class ETraits>
550 return (m_NumElements == 0);
553template<
typename E,
class ETraits>
559template<
typename E,
class ETraits>
565template<
typename E,
class ETraits>
570 return Node->m_Element;
573template<
typename E,
class ETraits>
578 return Node->m_Element;
581template<
typename E,
class ETraits>
586 return Node->m_Element;
589template<
typename E,
class ETraits>
594 return Node->m_Element;
597template<
typename E,
class ETraits>
601 return Node->m_Element;
604template<
typename E,
class ETraits>
608 return Node->m_Element;
611template<
typename E,
class ETraits>
617 m_HeadNode->m_Prev =
Node;
628template<
typename E,
class ETraits>
634 m_TailNode->m_Next =
Node;
645template <
typename E,
class ETraits>
651 AddHead(plNew->GetPrev(
pos));
654template <
typename E,
class ETraits>
660 AddTail(plNew->GetNext(
pos));
663template<
typename E,
class ETraits>
667 E Element(
Node->m_Element);
669 m_HeadNode =
Node->m_Next;
672 m_HeadNode->m_Prev =
NULL;
683template<
typename E,
class ETraits>
687 E Element(
Node->m_Element);
689 m_TailNode =
Node->m_Prev;
692 m_TailNode->m_Next =
NULL;
703template<
typename E,
class ETraits>
725template<
typename E,
class ETraits>
747template<
typename E,
class ETraits>
750 while (m_NumElements > 0)
753 m_HeadNode = m_HeadNode->m_Next;
768template<
typename E,
class ETraits>
774 if (OldNode == m_HeadNode)
776 m_HeadNode = OldNode->
m_Next;
782 if (OldNode == m_TailNode)
784 m_TailNode = OldNode->
m_Prev;
793template<
typename E,
class ETraits>
810 if (ETraits::CompareElements(
Node->m_Element,
element))
817template<
typename E,
class ETraits>
820 if (iElement >= m_NumElements)
823 if (m_HeadNode ==
NULL)
827 for (
size_t i = 0;
i < iElement;
i++)
835template<
typename E,
class ETraits>
879template<
typename E,
class ETraits>
888 CNode* NewNode = m_FreeNode;
893 m_FreeNode = NextFree;
901template<
typename E,
class ETraits>
907 pNode->m_Next = m_FreeNode;
911 if (m_NumElements == 0)
917template<
typename E,
class ETraits>
932 Node += (m_BlockSize - 1);
933 for (
int i = m_BlockSize - 1;
i >= 0;
i--)
935 Node->m_Next = m_FreeNode;
944template<
typename E,
class Allocator = CCRTAllocator >
946 public CAtlList<CHeapPtr<E, Allocator>, CHeapPtrElementTraits<E, Allocator> >
E & GetAt(size_t iElement)
ETraits::INARGTYPE INARGTYPE
void DestructItems(E *pData, size_t Size)
CAtlArray & operator=(_In_ const CAtlArray &)
void CreateItems(E *pData, size_t Size)
ETraits::OUTARGTYPE OUTARGTYPE
bool SetCount(size_t nNewSize, int nGrowBy=- 1)
CAtlArray(_In_ const CAtlArray &)
bool GrowAllocatedData(size_t nNewSize)
E & operator[](size_t ielement)
CNode(_In_ const CNode &)
CNode & operator=(_In_ const CNode &)
E & GetAt(_In_ POSITION pos)
void AddHeadList(_In_ const CAtlList< E, ETraits > *plNew)
POSITION GetTailPosition() const
CAtlList(_In_ UINT nBlockSize=10)
POSITION InsertAfter(_In_ POSITION pos, INARGTYPE element)
CAtlList & operator=(_In_ const CAtlList &)
POSITION AddHead(INARGTYPE element)
void AddTailList(_In_ const CAtlList< E, ETraits > *plNew)
POSITION FindIndex(_In_ size_t iElement) const
CAtlList(_In_ const CAtlList &)
POSITION AddTail(INARGTYPE element)
const E & GetAt(_In_ POSITION pos) const
const E & GetNext(_Inout_ POSITION &pos) const
POSITION GetHeadPosition() const
POSITION InsertBefore(_In_ POSITION pos, INARGTYPE element)
E & GetNext(_Inout_ POSITION &pos)
const E & GetPrev(_Inout_ POSITION &pos) const
POSITION Find(INARGTYPE element, _In_opt_ POSITION posStartAfter=NULL) const
void FreeNode(_Inout_ CNode *pNode)
E & GetPrev(_Inout_ POSITION &pos)
CNode * CreateNode(INARGTYPE element, _In_opt_ CNode *pPrev, _In_opt_ CNode *pNext)
void RemoveAt(_In_ POSITION pos)
ETraits::INARGTYPE INARGTYPE
void SwapElements(POSITION pos1, POSITION pos2)
static CAtlPlex * Create(_Inout_ CAtlPlex *&Entry, _In_ size_t MaxElements, _In_ size_t ElementSize)
static int CompareElementsOrdered(_In_ const T &Val1, _In_ const T &Val2)
static bool CompareElements(_In_ const T &Val1, _In_ const T &Val2)
static void RelocateElements(_Out_writes_all_(NumElements) T *Dest, _In_reads_(NumElements) T *Source, _In_ size_t NumElements)
static void CopyElements(_Out_writes_all_(NumElements) T *Dest, _In_reads_(NumElements) const T *Source, _In_ size_t NumElements)
CHeapPtr< T, Allocator > & INARGTYPE
CHeapPtrList(_In_ UINT nBlockSize=10)
CHeapPtrList(const CHeapPtrList &)
CHeapPtrList & operator=(const CHeapPtrList *)
#define HeapFree(x, y, z)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memmove(s1, s2, n)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
void AtlThrowImp(HRESULT hr)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
#define _Out_writes_all_(s)
base of all file and directory entries
#define new(TYPE, numElems)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize