ReactOS  0.4.13-dev-1089-g05f0b08
CPointerArray< T, GrowthRate > Class Template Reference

#include <rosui.h>

Collaboration diagram for CPointerArray< T, GrowthRate >:

Public Member Functions

 CPointerArray ()
 
 ~CPointerArray ()
 
virtual BOOL OnRemoveItem (T *ptr)
 
virtual INT OnCompareItems (T *p1, T *p2)
 
INT GetCount () const
 
TGet (INT i) const
 
BOOL Set (INT i, T *ptr)
 
INT Insert (INT at, T *ptr)
 
INT Append (T *ptr)
 
INT IndexOf (T *ptr) const
 
BOOL Remove (T *ptr)
 
BOOL RemoveAt (INT i)
 
BOOL Clear ()
 
BOOL Sort ()
 
INT Search (T *item, INT iStart, UINT uFlags)
 

Protected Attributes

HDPA m_hDpa
 

Static Private Member Functions

static INT CALLBACK s_OnRemoveItem (PVOID ptr, PVOID context)
 
static INT CALLBACK s_OnCompareItems (PVOID p1, PVOID p2, LPARAM lParam)
 

Detailed Description

template<class T, INT GrowthRate = 10>
class CPointerArray< T, GrowthRate >

Definition at line 13 of file rosui.h.

Constructor & Destructor Documentation

◆ CPointerArray()

template<class T, INT GrowthRate = 10>
CPointerArray< T, GrowthRate >::CPointerArray ( )
inline

Definition at line 19 of file rosui.h.

20  {
21  m_hDpa = DPA_Create(GrowthRate);
22  }
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
HDPA m_hDpa
Definition: rosui.h:16

◆ ~CPointerArray()

template<class T, INT GrowthRate = 10>
CPointerArray< T, GrowthRate >::~CPointerArray ( )
inline

Definition at line 24 of file rosui.h.

25  {
27  }
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
HDPA m_hDpa
Definition: rosui.h:16
static INT CALLBACK s_OnRemoveItem(PVOID ptr, PVOID context)
Definition: rosui.h:30

Member Function Documentation

◆ Append()

template<class T, INT GrowthRate = 10>
INT CPointerArray< T, GrowthRate >::Append ( T ptr)
inline

Definition at line 79 of file rosui.h.

80  {
81  return DPA_InsertPtr(m_hDpa, DA_LAST, ptr);
82  }
HDPA m_hDpa
Definition: rosui.h:16
static PVOID ptr
Definition: dispmode.c:27
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
#define DA_LAST
Definition: commctrl.h:4754

Referenced by CMainWindow::CreateHSplitter(), CMainWindow::CreateListView(), CMainWindow::CreateRichEdit(), CMainWindow::CreateStatusBar(), CMainWindow::CreateToolbar(), CMainWindow::CreateTreeView(), and CMainWindow::CreateVSplitter().

◆ Clear()

template<class T, INT GrowthRate = 10>
BOOL CPointerArray< T, GrowthRate >::Clear ( )
inline

Definition at line 104 of file rosui.h.

105  {
107  return DPA_DeleteAllPtrs(m_hDpa);
108  }
HDPA m_hDpa
Definition: rosui.h:16
BOOL WINAPI DPA_DeleteAllPtrs(HDPA hdpa)
Definition: dpa.c:730
VOID WINAPI DPA_EnumCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:969
static INT CALLBACK s_OnRemoveItem(PVOID ptr, PVOID context)
Definition: rosui.h:30

◆ Get()

template<class T, INT GrowthRate = 10>
T* CPointerArray< T, GrowthRate >::Get ( INT  i) const
inline

Definition at line 64 of file rosui.h.

65  {
66  return (T*) DPA_GetPtr(m_hDpa, i);
67  }
#define T
Definition: mbstring.h:31
HDPA m_hDpa
Definition: rosui.h:16
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
#define DPA_GetPtr
Definition: commctrl.h:5

Referenced by CUiPanel::ComputeContentBounds(), CUiPanel::ComputeMinimalSize(), CUiPanel::CountSizableChildren(), and CUiPanel::OnParentSize().

◆ GetCount()

template<class T, INT GrowthRate = 10>
INT CPointerArray< T, GrowthRate >::GetCount ( ) const
inline

Definition at line 59 of file rosui.h.

60  {
61  return DPA_GetPtrCount(m_hDpa);
62  }
HDPA m_hDpa
Definition: rosui.h:16
#define DPA_GetPtrCount(hdpa)
Definition: commctrl.h:4926

Referenced by CUiPanel::ComputeContentBounds(), CUiPanel::ComputeMinimalSize(), CUiPanel::CountSizableChildren(), and CUiPanel::OnParentSize().

◆ IndexOf()

template<class T, INT GrowthRate = 10>
INT CPointerArray< T, GrowthRate >::IndexOf ( T ptr) const
inline

Definition at line 84 of file rosui.h.

85  {
86  return DPA_GetPtrIndex(m_hDpa, ptr);
87  }
HDPA m_hDpa
Definition: rosui.h:16
static PVOID ptr
Definition: dispmode.c:27
INT WINAPI DPA_GetPtrIndex(HDPA hdpa, LPCVOID p)
Definition: dpa.c:561

Referenced by CPointerArray< CUiPrimitive >::Remove().

◆ Insert()

template<class T, INT GrowthRate = 10>
INT CPointerArray< T, GrowthRate >::Insert ( INT  at,
T ptr 
)
inline

Definition at line 74 of file rosui.h.

75  {
76  return DPA_InsertPtr(m_hDpa, at, ptr);
77  }
HDPA m_hDpa
Definition: rosui.h:16
static PVOID ptr
Definition: dispmode.c:27
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591

◆ OnCompareItems()

template<class T, INT GrowthRate = 10>
virtual INT CPointerArray< T, GrowthRate >::OnCompareItems ( T p1,
T p2 
)
inlinevirtual

Definition at line 48 of file rosui.h.

49  {
50  INT_PTR t = (reinterpret_cast<INT_PTR>(p2) - reinterpret_cast<INT_PTR>(p1));
51  if (t > 0)
52  return 1;
53  if (t < 0)
54  return -1;
55  return 0;
56  }
GLdouble GLdouble t
Definition: gl.h:2047
int32_t INT_PTR
Definition: typedefs.h:62

◆ OnRemoveItem()

template<class T, INT GrowthRate = 10>
virtual BOOL CPointerArray< T, GrowthRate >::OnRemoveItem ( T ptr)
inlinevirtual

Reimplemented in CUiCollection.

Definition at line 43 of file rosui.h.

44  {
45  return TRUE;
46  }
#define TRUE
Definition: types.h:120

Referenced by CPointerArray< CUiPrimitive >::RemoveAt().

◆ Remove()

template<class T, INT GrowthRate = 10>
BOOL CPointerArray< T, GrowthRate >::Remove ( T ptr)
inline

Definition at line 89 of file rosui.h.

90  {
91  INT i = IndexOf(ptr);
92  if (i < 0)
93  return FALSE;
94  return RemoveAt(i);
95  }
INT IndexOf(T *ptr) const
Definition: rosui.h:84
int32_t INT
Definition: typedefs.h:56
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
static PVOID ptr
Definition: dispmode.c:27
BOOL RemoveAt(INT i)
Definition: rosui.h:97

◆ RemoveAt()

template<class T, INT GrowthRate = 10>
BOOL CPointerArray< T, GrowthRate >::RemoveAt ( INT  i)
inline

Definition at line 97 of file rosui.h.

98  {
99  T* ptr = (T*) DPA_GetPtr(m_hDpa, i);
100  OnRemoveItem(ptr);
101  return DPA_DeletePtr(m_hDpa, i);
102  }
virtual BOOL OnRemoveItem(T *ptr)
Definition: rosui.h:43
#define T
Definition: mbstring.h:31
HDPA m_hDpa
Definition: rosui.h:16
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
static PVOID ptr
Definition: dispmode.c:27
#define DPA_GetPtr
Definition: commctrl.h:5
LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, INT i)
Definition: dpa.c:677

Referenced by CPointerArray< CUiPrimitive >::Remove().

◆ s_OnCompareItems()

template<class T, INT GrowthRate = 10>
static INT CALLBACK CPointerArray< T, GrowthRate >::s_OnCompareItems ( PVOID  p1,
PVOID  p2,
LPARAM  lParam 
)
inlinestaticprivate

Definition at line 36 of file rosui.h.

37  {
39  return self->OnCompareItems(reinterpret_cast<T*>(p1), reinterpret_cast<T*>(p2));
40  }
LPARAM lParam
Definition: combotst.c:139

Referenced by CPointerArray< CUiPrimitive >::Search(), and CPointerArray< CUiPrimitive >::Sort().

◆ s_OnRemoveItem()

template<class T, INT GrowthRate = 10>
static INT CALLBACK CPointerArray< T, GrowthRate >::s_OnRemoveItem ( PVOID  ptr,
PVOID  context 
)
inlinestaticprivate

Definition at line 30 of file rosui.h.

31  {
33  return (INT) self->OnRemoveItem(reinterpret_cast<T*>(ptr));
34  }
Definition: http.c:6587
int32_t INT
Definition: typedefs.h:56
static PVOID ptr
Definition: dispmode.c:27

Referenced by CPointerArray< CUiPrimitive >::Clear(), and CPointerArray< CUiPrimitive >::~CPointerArray().

◆ Search()

template<class T, INT GrowthRate = 10>
INT CPointerArray< T, GrowthRate >::Search ( T item,
INT  iStart,
UINT  uFlags 
)
inline

Definition at line 115 of file rosui.h.

116  {
117  return DPA_Search(m_hDpa, item, 0, s_OnCompareItems, (LPARAM)this, 0);
118  }
HDPA m_hDpa
Definition: rosui.h:16
LONG_PTR LPARAM
Definition: windef.h:208
static INT CALLBACK s_OnCompareItems(PVOID p1, PVOID p2, LPARAM lParam)
Definition: rosui.h:36
static ATOM item
Definition: dde.c:856
INT WINAPI DPA_Search(HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
Definition: dpa.c:845

◆ Set()

template<class T, INT GrowthRate = 10>
BOOL CPointerArray< T, GrowthRate >::Set ( INT  i,
T ptr 
)
inline

Definition at line 69 of file rosui.h.

70  {
71  return DPA_SetPtr(m_hDpa, i, ptr);
72  }
HDPA m_hDpa
Definition: rosui.h:16
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
static PVOID ptr
Definition: dispmode.c:27
BOOL WINAPI DPA_SetPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:626

◆ Sort()

template<class T, INT GrowthRate = 10>
BOOL CPointerArray< T, GrowthRate >::Sort ( )
inline

Definition at line 110 of file rosui.h.

111  {
112  return DPA_Sort(m_hDpa, s_OnCompareItems, (LPARAM)this);
113  }
HDPA m_hDpa
Definition: rosui.h:16
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
Definition: dpa.c:813
static INT CALLBACK s_OnCompareItems(PVOID p1, PVOID p2, LPARAM lParam)
Definition: rosui.h:36

Member Data Documentation

◆ m_hDpa


The documentation for this class was generated from the following file: