ReactOS  0.4.14-dev-1332-g6db3d88
atlcoll.h
Go to the documentation of this file.
1 #ifndef __ATLCOLL_H__
2 #define __ATLCOLL_H__
3 
4 #pragma once
5 #include "atlbase.h"
6 #include "atlexcept.h"
7 
8 // FIXME: We need to include <new> for placement new, but that would mean everyone using atl
9 // would also need to set the option 'WITH_STL'..
10 // For now we just copy the definition here, under a guard..
11 #ifndef _NEW
12 inline void* operator new (size_t size, void* ptr) throw() { return ptr; }
13 inline void operator delete (void* ptr, void* voidptr2) throw() { }
14 #endif
15 
16 
17 struct __POSITION
18 {
19 };
21 
22 
23 namespace ATL
24 {
25 
26 class CAtlPlex
27 {
28 public:
30 
31 #if (_AFX_PACKING >= 8)
32  DWORD dwReserved[1];
33 #endif
34 
35  static inline CAtlPlex* Create(
37  _In_ size_t MaxElements,
38  _In_ size_t ElementSize
39  )
40  {
41  CAtlPlex* Block;
42 
43  ATLASSERT(MaxElements > 0);
44  ATLASSERT(ElementSize > 0);
45 
46  size_t BufferSize = sizeof(CAtlPlex) + (MaxElements * ElementSize);
47 
49  if (Buffer == NULL) return NULL;
50 
51  Block = static_cast< CAtlPlex* >(Buffer);
52  Block->m_Next = Entry;
53  Entry = Block;
54 
55  return Block;
56  }
57 
58  void* GetData()
59  {
60  return (this + 1);
61  }
62 
63  inline void Destroy()
64  {
65  CAtlPlex* Block;
66  CAtlPlex* Next;
67 
68  Block = this;
69  while (Block != NULL)
70  {
71  Next = Block->m_Next;
72  HeapFree(GetProcessHeap(), 0, Block);
73  Block = Next;
74  }
75  }
76 };
77 
78 
79 template<typename T>
81 {
82 public:
83  typedef const T& INARGTYPE;
84  typedef T& OUTARGTYPE;
85 
86  static void CopyElements(
87  _Out_writes_all_(NumElements) T* Dest,
88  _In_reads_(NumElements) const T* Source,
89  _In_ size_t NumElements)
90  {
91  for (size_t i = 0; i < NumElements; i++)
92  {
93  Dest[i] = Source[i];
94  }
95  }
96 
97  static void RelocateElements(
98  _Out_writes_all_(NumElements) T* Dest,
99  _In_reads_(NumElements) T* Source,
100  _In_ size_t NumElements)
101  {
102  // A simple memmove works for most of the types.
103  // You'll have to override this for types that have pointers to their
104  // own members.
105 
106 #if defined(__GNUC__) && __GNUC__ >= 8
107  #pragma GCC diagnostic push
108  #pragma GCC diagnostic ignored "-Wclass-memaccess"
109 #endif
110  memmove(Dest, Source, NumElements * sizeof(T));
111 #if defined(__GNUC__) && __GNUC__ >= 8
112  #pragma GCC diagnostic pop
113 #endif
114  }
115 };
116 
117 template<typename T>
119 {
120 public:
121  static bool CompareElements(
122  _In_ const T& Val1,
123  _In_ const T& Val2)
124  {
125  return (Val1 == Val2);
126  }
127 
129  _In_ const T& Val1,
130  _In_ const T& Val2)
131  {
132  if (Val1 < Val2)
133  {
134  return -1;
135  }
136  else if (Val1 > Val2)
137  {
138  return 1;
139  }
140 
141  return 0; // equal
142  }
143 };
144 
145 template<typename T>
147  public CElementTraitsBase<T>,
148  public CDefaultCompareTraits<T>
149 {
150 };
151 
152 
153 template<typename T>
155  public CDefaultElementTraits<T>
156 {
157 };
158 
159 
160 template<typename T, class Allocator = CCRTAllocator>
162  public CDefaultElementTraits< CHeapPtr<T, Allocator> >
163 {
164 public:
166  typedef T*& OUTARGTYPE;
167 };
168 
169 
170 
171 template<typename E, class ETraits = CElementTraits<E> >
173 {
174 public:
175  typedef typename ETraits::INARGTYPE INARGTYPE;
176  typedef typename ETraits::OUTARGTYPE OUTARGTYPE;
177 
178 private:
180  size_t m_Size;
182  size_t m_GrowBy;
183 
184 
185 #pragma push_macro("new")
186 #undef new
187 
188  void CreateItems(E* pData, size_t Size)
189  {
190  for (size_t n = 0; n < Size; ++n)
191  {
192  ::new (pData + n) E;
193  }
194  }
195 
196 #pragma pop_macro("new")
197 
198  void DestructItems(E* pData, size_t Size)
199  {
200  for (size_t n = 0; n < Size; ++n)
201  {
202  pData[n].~E();
203  }
204  }
205 
206  bool GrowAllocatedData(size_t nNewSize)
207  {
208  if (m_pData)
209  {
210  size_t addSize = m_GrowBy > 0 ? m_GrowBy : m_AllocatedSize / 2;
211  size_t allocSize = m_AllocatedSize + addSize;
212  if (allocSize < nNewSize)
213  allocSize = nNewSize;
214 
215  E* pData = (E*)malloc(nNewSize * sizeof(E));
216 
217  if (pData == NULL)
218  {
219  return false;
220  }
221 
222  // Copy the objects over (default implementation will just move them without calling anything
223  ETraits::RelocateElements(pData, m_pData, m_Size);
224 
225  free(m_pData);
226  m_pData = pData;
227  m_AllocatedSize = nNewSize;
228  }
229  else
230  {
231  // We need to allocate a new buffer
232  size_t allocSize = m_GrowBy > nNewSize ? m_GrowBy : nNewSize;
233  m_pData = (E*)malloc(allocSize * sizeof(E));
234  if (m_pData == NULL)
235  {
236  return false;
237  }
238  m_AllocatedSize = allocSize;
239  }
240  return true;
241  }
242 
243  /* The CAtlArray class does not support construction by copy */
244 private:
245  CAtlArray(_In_ const CAtlArray&);
247 
248 public:
249  CAtlArray();
250  ~CAtlArray();
251 
252  size_t Add(INARGTYPE element);
253  size_t Add();
254 
255  bool SetCount(size_t nNewSize, int nGrowBy = - 1);
256  size_t GetCount() const;
257 
258  E& operator[](size_t ielement);
259  const E& operator[](size_t ielement) const;
260 
261  E& GetAt(size_t iElement);
262  const E& GetAt(size_t iElement) const;
263 
264  //FIXME: Most of this class is missing!
265 };
266 
267 //
268 // CAtlArray public methods
269 //
270 
271 template<typename E, class ETraits>
273  : m_pData(NULL)
274  , m_Size(0)
275  , m_AllocatedSize(0)
276  , m_GrowBy(0)
277 {
278 }
279 
280 template<typename E, class ETraits>
282 {
283  // Destroy all items
284  SetCount(0, -1);
285 }
286 
287 #pragma push_macro("new")
288 #undef new
289 
290 template<typename E, class ETraits>
292 {
293  if (m_Size >= m_AllocatedSize)
294  {
295  if (!GrowAllocatedData(m_Size + 1))
296  {
298  }
299  }
300 
301  ::new (m_pData + m_Size) E(element);
302  m_Size++;
303 
304  return m_Size - 1;
305 }
306 
307 #pragma pop_macro("new")
308 
309 template<typename E, class ETraits>
311 {
312  if (!SetCount(m_Size + 1))
313  {
315  }
316 
317  return m_Size - 1;
318 }
319 
320 template<typename E, class ETraits>
321 bool CAtlArray<E, ETraits>::SetCount(size_t nNewSize, int nGrowBy /*= -1*/)
322 {
323 
324  if (nGrowBy > -1)
325  {
326  m_GrowBy = (size_t)nGrowBy;
327  }
328 
329  if (nNewSize == m_Size)
330  {
331  // Do nothing
332  }
333  else if (nNewSize == 0)
334  {
335  if (m_pData)
336  {
337  DestructItems(m_pData, m_Size);
338  m_pData = NULL;
339  }
340  m_Size = m_AllocatedSize = NULL;
341  }
342  else if (nNewSize < m_AllocatedSize)
343  {
344  if (nNewSize > m_Size)
345  {
346  CreateItems(m_pData + m_Size, nNewSize - m_Size);
347  }
348  else
349  {
350  DestructItems(m_pData + nNewSize, m_Size - nNewSize);
351  }
352  m_Size = nNewSize;
353  }
354  else
355  {
356  if (!GrowAllocatedData(nNewSize))
357  {
358  return false;
359  }
360 
361  CreateItems(m_pData + m_Size, nNewSize - m_Size);
362  m_Size = nNewSize;
363  }
364 
365  return true;
366 }
367 
368 template<typename E, class ETraits>
370 {
371  return m_Size;
372 }
373 
374 template<typename E, class ETraits>
376 {
377  ATLASSERT(iElement < m_Size);
378 
379  return m_pData[iElement];
380 }
381 
382 template<typename E, class ETraits>
383 const E& CAtlArray<E, ETraits>::operator[](size_t iElement) const
384 {
385  ATLASSERT(iElement < m_Size);
386 
387  return m_pData[iElement];
388 }
389 
390 template<typename E, class ETraits>
392 {
393  ATLASSERT(iElement < m_Size);
394 
395  return m_pData[iElement];
396 }
397 
398 template<typename E, class ETraits>
399 const E& CAtlArray<E, ETraits>::GetAt(size_t iElement) const
400 {
401  ATLASSERT(iElement < m_Size);
402 
403  return m_pData[iElement];
404 }
405 
406 
407 
408 template<typename E, class ETraits = CElementTraits<E> >
409 class CAtlList
410 {
411 private:
412  typedef typename ETraits::INARGTYPE INARGTYPE;
413 
414 private:
415  class CNode : public __POSITION
416  {
417  public:
421 
422  public:
423  CNode(INARGTYPE Element) :
424  m_Element(Element)
425  {
426  }
427 
428  /* The CNode class does not support construction by copy */
429  private:
430  CNode(_In_ const CNode&);
431  CNode& operator=(_In_ const CNode&);
432  };
433 
434 private:
441 
442 /* The CAtlList class does not support construction by copy */
443 private:
444  CAtlList(_In_ const CAtlList&);
445  CAtlList& operator=(_In_ const CAtlList&);
446 
447 public:
448  CAtlList(_In_ UINT nBlockSize = 10);
449  ~CAtlList();
450 
451  size_t GetCount() const;
452  bool IsEmpty() const;
453 
454  POSITION GetHeadPosition() const;
455  POSITION GetTailPosition() const;
456 
458  const E& GetNext(_Inout_ POSITION& pos) const;
460  const E& GetPrev(_Inout_ POSITION& pos) const;
461 
462  E& GetAt(_In_ POSITION pos);
463  const E& GetAt(_In_ POSITION pos) const;
464 
467 
468  E RemoveHead();
469  E RemoveTail();
470 
473 
474  void RemoveAll();
475  void RemoveAt(_In_ POSITION pos);
476 
477  POSITION Find(
479  _In_opt_ POSITION posStartAfter = NULL) const;
480  POSITION FindIndex(_In_ size_t iElement) const;
481 
482 private:
483  CNode* CreateNode(
485  _In_opt_ CNode* pPrev,
486  _In_opt_ CNode* pNext
487  );
488 
489  void FreeNode(
490  _Inout_ CNode* pNode
491  );
492 
494  );
495 
496 };
497 
498 
499 //
500 // CAtlist public methods
501 //
502 
503 template<typename E, class ETraits>
505  m_Blocks(NULL),
506  m_BlockSize(nBlockSize),
507  m_HeadNode(NULL),
508  m_TailNode(NULL),
509  m_FreeNode(NULL),
510  m_NumElements(0)
511 {
512  ATLASSERT(nBlockSize > 0);
513 }
514 
515 template<typename E, class ETraits>
517 {
518  RemoveAll();
519 }
520 
521 template<typename E, class ETraits>
522 inline size_t CAtlList< E, ETraits >::GetCount() const
523 {
524  return m_NumElements;
525 }
526 
527 template<typename E, class ETraits>
529 {
530  return (m_NumElements == 0);
531 }
532 
533 template<typename E, class ETraits>
535 {
536  return (POSITION)m_HeadNode;
537 }
538 
539 template<typename E, class ETraits>
541 {
542  return (POSITION)m_TailNode;
543 }
544 
545 template<typename E, class ETraits>
547 {
548  CNode* Node = (CNode*)pos;
549  pos = (POSITION)Node->m_Next;
550  return Node->m_Element;
551 }
552 
553 template<typename E, class ETraits>
555 {
556  CNode* Node = (CNode*)pos;
557  pos = (POSITION)Node->m_Next;
558  return Node->m_Element;
559 }
560 
561 template<typename E, class ETraits>
563 {
564  CNode* Node = (CNode*)pos;
565  pos = (POSITION)Node->m_Prev;
566  return Node->m_Element;
567 }
568 
569 template<typename E, class ETraits>
571 {
572  CNode* Node = (CNode*)pos;
573  pos = (POSITION)Node->m_Prev;
574  return Node->m_Element;
575 }
576 
577 template<typename E, class ETraits>
579 {
580  CNode* Node = (CNode*)pos;
581  return Node->m_Element;
582 }
583 
584 template<typename E, class ETraits>
586 {
587  CNode* Node = (CNode*)pos;
588  return Node->m_Element;
589 }
590 
591 template<typename E, class ETraits>
593 {
594  CNode* Node = CreateNode(element, NULL, m_HeadNode);
595  if (m_HeadNode)
596  {
597  m_HeadNode->m_Prev = Node;
598  }
599  else
600  {
601  m_TailNode = Node;
602  }
603  m_HeadNode = Node;
604 
605  return (POSITION)Node;
606 }
607 
608 template<typename E, class ETraits>
610 {
611  CNode* Node = CreateNode(element, m_TailNode, NULL);
612  if (m_TailNode)
613  {
614  m_TailNode->m_Next = Node;
615  }
616  else
617  {
618  m_HeadNode = Node;
619  }
620  m_TailNode = Node;
621 
622  return (POSITION)Node;
623 }
624 
625 template<typename E, class ETraits>
627 {
628  CNode* Node = m_HeadNode;
629  E Element(Node->m_Element);
630 
631  m_HeadNode = Node->m_Next;
632  if (m_HeadNode)
633  {
634  m_HeadNode->m_Prev = NULL;
635  }
636  else
637  {
638  m_TailNode = NULL;
639  }
640  FreeNode(Node);
641 
642  return Element;
643 }
644 
645 template<typename E, class ETraits>
647 {
648  CNode* Node = m_TailNode;
649  E Element(Node->m_Element);
650 
651  m_TailNode = Node->m_Prev;
652  if (m_TailNode)
653  {
654  m_TailNode->m_Next = NULL;
655  }
656  else
657  {
658  m_HeadNode = NULL;
659  }
660  FreeNode(Node);
661 
662  return Element;
663 }
664 
665 template<typename E, class ETraits>
667 {
668  if (pos == NULL)
669  return AddHead(element);
670 
671  CNode* OldNode = (CNode*)pos;
672  CNode* Node = CreateNode(element, OldNode->m_Prev, OldNode);
673 
674  if (OldNode->m_Prev != NULL)
675  {
676  OldNode->m_Prev->m_Next = Node;
677  }
678  else
679  {
680  m_HeadNode = Node;
681  }
682  OldNode->m_Prev = Node;
683 
684  return (POSITION)Node;
685 }
686 
687 template<typename E, class ETraits>
689 {
690  if (pos == NULL)
691  return AddTail(element);
692 
693  CNode* OldNode = (CNode*)pos;
694  CNode* Node = CreateNode(element, OldNode, OldNode->m_Next);
695 
696  if (OldNode->m_Next != NULL)
697  {
698  OldNode->m_Next->m_Prev = Node;
699  }
700  else
701  {
702  m_TailNode = Node;
703  }
704  OldNode->m_Next = Node;
705 
706  return (POSITION)Node;
707 }
708 
709 template<typename E, class ETraits>
711 {
712  while (m_NumElements > 0)
713  {
714  CNode* Node = m_HeadNode;
715  m_HeadNode = m_HeadNode->m_Next;
716  FreeNode(Node);
717  }
718 
719  m_HeadNode = NULL;
720  m_TailNode = NULL;
721  m_FreeNode = NULL;
722 
723  if (m_Blocks)
724  {
725  m_Blocks->Destroy();
726  m_Blocks = NULL;
727  }
728 }
729 
730 template<typename E, class ETraits>
732 {
733  ATLASSERT(pos != NULL);
734 
735  CNode* OldNode = (CNode*)pos;
736  if (OldNode == m_HeadNode)
737  {
738  m_HeadNode = OldNode->m_Next;
739  }
740  else
741  {
742  OldNode->m_Prev->m_Next = OldNode->m_Next;
743  }
744  if (OldNode == m_TailNode)
745  {
746  m_TailNode = OldNode->m_Prev;
747  }
748  else
749  {
750  OldNode->m_Next->m_Prev = OldNode->m_Prev;
751  }
752  FreeNode(OldNode);
753 }
754 
755 template<typename E, class ETraits>
758  _In_opt_ POSITION posStartAfter) const
759 {
760  CNode* Node = (CNode*)posStartAfter;
761  if (Node == NULL)
762  {
763  Node = m_HeadNode;
764  }
765  else
766  {
767  Node = Node->m_Next;
768  }
769 
770  for (; Node != NULL; Node = Node->m_Next)
771  {
772  if (ETraits::CompareElements(Node->m_Element, element))
773  return (POSITION)Node;
774  }
775 
776  return NULL;
777 }
778 
779 template<typename E, class ETraits>
781 {
782  if (iElement >= m_NumElements)
783  return NULL;
784 
785  if (m_HeadNode == NULL)
786  return NULL;
787 
788  CNode* Node = m_HeadNode;
789  for (size_t i = 0; i < iElement; i++)
790  {
791  Node = Node->m_Next;
792  }
793 
794  return (POSITION)Node;
795 }
796 
797 
798 //
799 // CAtlist private methods
800 //
801 
802 template<typename E, class ETraits>
805  _In_opt_ CNode* Prev,
806  _In_opt_ CNode* Next
807  )
808 {
809  GetFreeNode();
810 
811  CNode* NewNode = m_FreeNode;
812  CNode* NextFree = m_FreeNode->m_Next;
813 
814  NewNode = new CNode(element);
815 
816  m_FreeNode = NextFree;
817  NewNode->m_Prev = Prev;
818  NewNode->m_Next = Next;
819  m_NumElements++;
820 
821  return NewNode;
822 }
823 
824 template<typename E, class ETraits>
826  _Inout_ CNode* pNode
827  )
828 {
829  pNode->~CNode();
830  pNode->m_Next = m_FreeNode;
831  m_FreeNode = pNode;
832 
833  m_NumElements--;
834  if (m_NumElements == 0)
835  {
836  RemoveAll();
837  }
838 }
839 
840 template<typename E, class ETraits>
842 {
843  if (m_FreeNode)
844  {
845  return m_FreeNode;
846  }
847 
848  CAtlPlex* Block = CAtlPlex::Create(m_Blocks, m_BlockSize, sizeof(CNode));
849  if (Block == NULL)
850  {
852  }
853 
854  CNode* Node = (CNode*)Block->GetData();
855  Node += (m_BlockSize - 1);
856  for (int i = m_BlockSize - 1; i >= 0; i--)
857  {
858  Node->m_Next = m_FreeNode;
859  m_FreeNode = Node;
860  Node--;
861  }
862 
863  return m_FreeNode;
864 }
865 
866 
867 template<typename E, class Allocator = CCRTAllocator >
869  public CAtlList<CHeapPtr<E, Allocator>, CHeapPtrElementTraits<E, Allocator> >
870 {
871 public:
872  CHeapPtrList(_In_ UINT nBlockSize = 10) :
873  CAtlList<CHeapPtr<E, Allocator>, CHeapPtrElementTraits<E, Allocator> >(nBlockSize)
874  {
875  }
876 
877 private:
878  CHeapPtrList(const CHeapPtrList&);
879  CHeapPtrList& operator=(const CHeapPtrList*);
880 };
881 
882 
883 }
884 
885 #endif
E & GetPrev(_Inout_ POSITION &pos)
Definition: atlcoll.h:562
POSITION GetHeadPosition() const
Definition: atlcoll.h:534
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static int CompareElementsOrdered(_In_ const T &Val1, _In_ const T &Val2)
Definition: atlcoll.h:128
ETraits::INARGTYPE INARGTYPE
Definition: atlcoll.h:175
size_t m_Size
Definition: atlcoll.h:180
#define new(TYPE, numElems)
Definition: treelist.c:54
struct _Entry Entry
Definition: kefuncs.h:627
bool SetCount(size_t nNewSize, int nGrowBy=- 1)
Definition: atlcoll.h:321
UINT m_BlockSize
Definition: atlcoll.h:436
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
CAtlPlex * m_Blocks
Definition: atlcoll.h:435
POSITION FindIndex(_In_ size_t iElement) const
Definition: atlcoll.h:780
ETraits::OUTARGTYPE OUTARGTYPE
Definition: atlcoll.h:176
_In_ BOOLEAN Create
Definition: pstypes.h:511
#define _In_reads_(size)
Definition: no_sal2.h:228
#define free
Definition: debug_ros.c:5
GLdouble n
Definition: glext.h:7729
CNode * CreateNode(INARGTYPE element, _In_opt_ CNode *pPrev, _In_opt_ CNode *pNext)
Definition: atlcoll.h:803
void FreeNode(_Inout_ CNode *pNode)
Definition: atlcoll.h:825
#define T
Definition: mbstring.h:31
static bool CompareElements(_In_ const T &Val1, _In_ const T &Val2)
Definition: atlcoll.h:121
#define _In_opt_
Definition: no_sal2.h:213
#define AtlThrow(x)
Definition: atldef.h:20
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
Definition: glfuncs.h:248
size_t GetCount() const
Definition: atlcoll.h:369
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
POSITION InsertBefore(_In_ POSITION pos, INARGTYPE element)
Definition: atlcoll.h:666
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
union node Node
Definition: types.h:1255
static PVOID ptr
Definition: dispmode.c:27
const T & INARGTYPE
Definition: atlcoll.h:83
E RemoveTail()
Definition: atlcoll.h:646
E & GetAt(size_t iElement)
Definition: atlcoll.h:391
smooth NULL
Definition: ftsmooth.c:416
CAtlList & operator=(_In_ const CAtlList &)
size_t m_GrowBy
Definition: atlcoll.h:182
Definition: bufpool.h:45
CNode(INARGTYPE Element)
Definition: atlcoll.h:423
void Destroy()
Definition: atlcoll.h:63
size_t GetCount() const
Definition: atlcoll.h:522
CNode * GetFreeNode()
Definition: atlcoll.h:841
Definition: Node.h:12
__kernel_size_t size_t
Definition: linux.h:237
Definition: rosdlgs.h:5
E & GetNext(_Inout_ POSITION &pos)
Definition: atlcoll.h:546
void * GetData()
Definition: atlcoll.h:58
void CreateItems(E *pData, size_t Size)
Definition: atlcoll.h:188
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const WCHAR RemoveAll[]
Definition: msiexec.c:48
void DestructItems(E *pData, size_t Size)
Definition: atlcoll.h:198
#define BufferSize
Definition: classpnp.h:419
unsigned long DWORD
Definition: ntddk_ex.h:95
void AtlThrowImp(HRESULT hr)
Definition: atlexcept.h:18
POSITION GetTailPosition() const
Definition: atlcoll.h:540
#define _Inout_
Definition: no_sal2.h:244
void RemoveAll()
Definition: atlcoll.h:710
E & GetAt(_In_ POSITION pos)
Definition: atlcoll.h:578
static void CopyElements(_Out_writes_all_(NumElements) T *Dest, _In_reads_(NumElements) const T *Source, _In_ size_t NumElements)
Definition: atlcoll.h:86
E & operator[](size_t ielement)
Definition: atlcoll.h:375
size_t m_NumElements
Definition: atlcoll.h:440
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
CNode * m_FreeNode
Definition: atlcoll.h:439
bool GrowAllocatedData(size_t nNewSize)
Definition: atlcoll.h:206
#define _Out_writes_all_(size)
Definition: no_sal2.h:368
POSITION InsertAfter(_In_ POSITION pos, INARGTYPE element)
Definition: atlcoll.h:688
static void RelocateElements(_Out_writes_all_(NumElements) T *Dest, _In_reads_(NumElements) T *Source, _In_ size_t NumElements)
Definition: atlcoll.h:97
#define _In_
Definition: no_sal2.h:204
static const WCHAR E[]
Definition: oid.c:1253
POSITION AddTail(INARGTYPE element)
Definition: atlcoll.h:609
CNode * m_HeadNode
Definition: atlcoll.h:437
E RemoveHead()
Definition: atlcoll.h:626
CHeapPtrList(_In_ UINT nBlockSize=10)
Definition: atlcoll.h:872
size_t m_AllocatedSize
Definition: atlcoll.h:181
__POSITION * POSITION
Definition: atlcoll.h:20
unsigned int UINT
Definition: ndis.h:50
CNode & operator=(_In_ const CNode &)
static CAtlPlex * Create(_Inout_ CAtlPlex *&Entry, _In_ size_t MaxElements, _In_ size_t ElementSize)
Definition: atlcoll.h:35
CAtlPlex * m_Next
Definition: atlcoll.h:29
void RemoveAt(_In_ POSITION pos)
Definition: atlcoll.h:731
#define malloc
Definition: debug_ros.c:4
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
CAtlArray & operator=(_In_ const CAtlArray &)
POSITION Find(INARGTYPE element, _In_opt_ POSITION posStartAfter=NULL) const
Definition: atlcoll.h:756
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
CAtlList(_In_ const CAtlList &)
ETraits::INARGTYPE INARGTYPE
Definition: atlcoll.h:412
CHeapPtr< T, Allocator > & INARGTYPE
Definition: atlcoll.h:165
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82
POSITION AddHead(INARGTYPE element)
Definition: atlcoll.h:592
bool IsEmpty() const
Definition: atlcoll.h:528
CNode * m_TailNode
Definition: atlcoll.h:438
Definition: dlist.c:348
size_t Add()
Definition: atlcoll.h:310