ReactOS 0.4.15-dev-7931-gfd331f1
CList< Item > Class Template Reference

#include <list.h>

Collaboration diagram for CList< Item >:

Public Member Functions

 CList ()
 
 ~CList ()
 
CListoperator= (CList &)
 
CIterator< Item > * CreateIterator () const
 
LONG Count () const
 
ItemGet (const LONG index) const
 
VOID Insert (Item &element)
 
VOID Remove (Item &element)
 
VOID RemoveAll ()
 
CListNodeGetHeader () const
 
CListNodeGetTrailer () const
 

Private Member Functions

CListNodeSearch (Item &element) const
 

Private Attributes

LONG NodeCount
 
CListNodeHeader
 
CListNodeTrailer
 

Detailed Description

template<class Item>
class CList< Item >

Definition at line 34 of file list.h.

Constructor & Destructor Documentation

◆ CList()

template<class Item >
CList< Item >::CList

Definition at line 73 of file list.h.

74{
75 // Create dummy nodes
76 Trailer = new CListNode;
77 Header = new CListNode;
78 Header->SetNext(Trailer);
80}
Definition: list.h:12
VOID SetPrev(CListNode *prev)
Definition: list.cpp:73
CListNode * Trailer
Definition: list.h:54
Definition: Header.h:9

◆ ~CList()

template<class Item >
CList< Item >::~CList

Definition at line 84 of file list.h.

85{
86 RemoveAll();
87 delete Trailer;
88 delete Header;
89}
CListNode * Header
Definition: list.h:53
VOID RemoveAll()
Definition: list.h:150

Member Function Documentation

◆ Count()

template<class Item >
LONG CList< Item >::Count

Definition at line 100 of file list.h.

101{
102 return NodeCount;
103}
LONG NodeCount
Definition: list.h:52

◆ CreateIterator()

template<class Item >
CIterator< Item > * CList< Item >::CreateIterator

Definition at line 93 of file list.h.

94{
95 return new CListIterator<Item>((CList<Item> *) this);
96}
Definition: list.h:34

Referenced by CConfig::Clear(), and CHttpClient::ProcessRequest().

◆ Get()

template<class Item >
Item & CList< Item >::Get ( const LONG  index) const

Definition at line 107 of file list.h.

108{
110
111 if ((index < 0) || (index >= NodeCount))
112 return NULL;
113
114 node = Header;
115 for (int i = 0; i <= index; i++)
116 node = node->GetNext();
117
118 return (Item *) node->GetElement();
119}
#define index(s, c)
Definition: various.h:29
#define NULL
Definition: types.h:112
GLuint index
Definition: glext.h:6031
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
Definition: dlist.c:348
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

◆ GetHeader()

template<class Item >
CListNode * CList< Item >::GetHeader

Definition at line 168 of file list.h.

169{
170 return Header;
171}

◆ GetTrailer()

template<class Item >
CListNode * CList< Item >::GetTrailer

Definition at line 175 of file list.h.

176{
177 return Trailer;
178}

◆ Insert()

template<class Item >
VOID CList< Item >::Insert ( Item element)

Definition at line 123 of file list.h.

124{
126
130 NodeCount++;
131}
CListNode * GetPrev()
Definition: list.cpp:91
VOID SetNext(CListNode *next)
Definition: list.cpp:67

Referenced by CConfig::Default().

◆ operator=()

template<class Item >
CList & CList< Item >::operator= ( CList< Item > &  )

◆ Remove()

template<class Item >
VOID CList< Item >::Remove ( Item element)

Definition at line 135 of file list.h.

136{
138
140 if (node != NULL) {
141 node->GetPrev()->SetNext(node->GetNext());
142 node->GetNext()->SetPrev(node->GetPrev());
143 NodeCount--;
144 delete node;
145 }
146}
CListNode * Search(Item &element) const
Definition: list.h:182

◆ RemoveAll()

template<class Item >
VOID CList< Item >::RemoveAll

Definition at line 150 of file list.h.

151{
153 CListNode *tmp;
154
155 node = Header->GetNext();
156 while (node != Trailer) {
157 tmp = node->GetNext();
158 delete node;
159 node = tmp;
160 }
161 Header->SetNext(Trailer);
163 NodeCount = 0;
164}

Referenced by CConfig::Reset().

◆ Search()

template<class Item >
CListNode * CList< Item >::Search ( Item element) const
private

Definition at line 182 of file list.h.

183{
185
186 node = Header;
187 while (((node = node->GetNext()) != Trailer) && (node->GetElement() != element));
188 if (node != Trailer)
189 return node;
190 else
191 return NULL;
192}

Member Data Documentation

◆ Header

template<class Item >
CListNode* CList< Item >::Header
private

Definition at line 53 of file list.h.

◆ NodeCount

template<class Item >
LONG CList< Item >::NodeCount
private

Definition at line 52 of file list.h.

◆ Trailer

template<class Item >
CListNode* CList< Item >::Trailer
private

Definition at line 54 of file list.h.


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