ReactOS 0.4.16-dev-340-g0540c21
CUIFObjectArray Class Reference

#include <cicuif.h>

Inheritance diagram for CUIFObjectArray:
Collaboration diagram for CUIFObjectArray:

Public Member Functions

 CUIFObjectArray ()
 
BOOL Add (CUIFObject *pObject)
 
BOOL Remove (CUIFObject *pObject)
 
CUIFObjectGetLast () const
 
- Public Member Functions inherited from CicArray< CUIFObject * >
 CicArray ()
 
CUIFObject * * data () const
 
size_t size () const
 
bool empty () const
 
void clear ()
 
CUIFObject * & operator[] (size_t iItem)
 
const CUIFObject * & operator[] (size_t iItem) const
 
CUIFObject * * Append (size_t cGrow)
 
BOOL Add (const CUIFObject * &item)
 
ptrdiff_t Find (const CUIFObject * &item) const
 
BOOL Insert (size_t iItem, size_t cGrow)
 
void Remove (size_t iItem, size_t cRemove=1)
 

Additional Inherited Members

- Protected Member Functions inherited from CicArrayBase
 CicArrayBase (size_t cbItem)
 
virtual ~CicArrayBase ()
 
BOOL Insert (size_t iItem, size_t cGrow)
 
LPVOID Append (size_t cGrow)
 
void Remove (size_t iItem, size_t cRemove=1)
 
- Protected Attributes inherited from CicArrayBase
LPBYTE m_pb
 
size_t m_cItems
 
size_t m_cbItem
 
size_t m_cCapacity
 

Detailed Description

Definition at line 135 of file cicuif.h.

Constructor & Destructor Documentation

◆ CUIFObjectArray()

CUIFObjectArray::CUIFObjectArray ( )
inline

Definition at line 138 of file cicuif.h.

138{ }

Member Function Documentation

◆ Add()

BOOL CUIFObjectArray::Add ( CUIFObject pObject)
inline

Definition at line 140 of file cicuif.h.

141 {
142 if (!pObject || Find(pObject) >= 0)
143 return FALSE;
144
145 CUIFObject **ppNew = Append(1);
146 if (!ppNew)
147 return FALSE;
148
149 *ppNew = pObject;
150 return TRUE;
151 }
ptrdiff_t Find(const CUIFObject * &item) const
Definition: cicarray.h:69
CUIFObject * * Append(size_t cGrow)
Definition: cicarray.h:52
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
FxObject * pObject

◆ GetLast()

CUIFObject * CUIFObjectArray::GetLast ( ) const
inline

Definition at line 170 of file cicuif.h.

171 {
172 if (empty())
173 return NULL;
174 return (*this)[size() - 1];
175 }
size_t size() const
Definition: cicarray.h:34
bool empty() const
Definition: cicarray.h:35
#define NULL
Definition: types.h:112

◆ Remove()

BOOL CUIFObjectArray::Remove ( CUIFObject pObject)
inline

Definition at line 153 of file cicuif.h.

154 {
155 if (!pObject)
156 return FALSE;
157
158 ptrdiff_t iItem = Find(pObject);
159 if (iItem < 0)
160 return FALSE;
161
162 if (size_t(iItem) + 1 < size())
163 MoveMemory(&data()[iItem], &data()[iItem + 1],
164 (size() - (iItem + 1)) * sizeof(CUIFObject*));
165
166 --m_cItems;
167 return TRUE;
168 }
size_t m_cItems
Definition: cicarray.h:16
CUIFObject * * data() const
Definition: cicarray.h:33
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
#define MoveMemory
Definition: winbase.h:1734

Referenced by CUIFWindow::~CUIFWindow().


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