ReactOS 0.4.15-dev-7953-g1f49173
FxCollectionInternal Struct Reference

#include <fxcollection.hpp>

Inheritance diagram for FxCollectionInternal:
Collaboration diagram for FxCollectionInternal:

Public Member Functions

 FxCollectionInternal (VOID)
 
 ~FxCollectionInternal (VOID)
 
_Must_inspect_result_ FxCollectionEntryFindEntry (__in ULONG Index)
 
_Must_inspect_result_ FxCollectionEntryFindEntryByObject (__in FxObject *Object)
 
ULONG Count (VOID)
 
BOOLEAN Add (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Item)
 
_Must_inspect_result_ FxObjectGetItem (__in ULONG Index)
 
_Must_inspect_result_ FxObjectGetFirstItem (VOID)
 
_Must_inspect_result_ FxObjectGetLastItem (VOID)
 
NTSTATUS Remove (__in ULONG Index)
 
VOID CleanupEntry (__in FxCollectionEntry *Entry)
 
VOID CleanupEntryObject (__in FxObject *Object)
 
NTSTATUS RemoveEntry (__in FxCollectionEntry *Entry)
 
_Must_inspect_result_ NTSTATUS RemoveItem (__in FxObject *Item)
 
_Must_inspect_result_ FxCollectionEntryStart (VOID)
 
_Must_inspect_result_ FxCollectionEntryEnd (VOID)
 
VOID Clear (VOID)
 

Protected Member Functions

_Must_inspect_result_ FxCollectionEntryAllocateEntry (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID AddEntry (__in FxCollectionEntry *Node, __in FxObject *Item)
 

Protected Attributes

ULONG m_Count
 
LIST_ENTRY m_ListHead
 

Detailed Description

Definition at line 56 of file fxcollection.hpp.

Constructor & Destructor Documentation

◆ FxCollectionInternal()

FxCollectionInternal::FxCollectionInternal ( VOID  )

Definition at line 28 of file fxcollection.cpp.

31{
32 m_Count = 0;
34}
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

◆ ~FxCollectionInternal()

FxCollectionInternal::~FxCollectionInternal ( VOID  )

Definition at line 36 of file fxcollection.cpp.

39{
40 Clear();
41}
static void Clear(void)
Definition: treeview.c:386

Member Function Documentation

◆ Add()

BOOLEAN FxCollectionInternal::Add ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in FxObject Item 
)

Definition at line 62 of file fxcollection.cpp.

66{
67 FxCollectionEntry *pNode;
68
69 pNode = AllocateEntry(FxDriverGlobals);
70
71 if (pNode != NULL) {
73
74 AddEntry(pNode, Item);
75 }
76
77 return pNode != NULL;
78}
LIST_ENTRY m_ListEntry
#define NULL
Definition: types.h:112
#define InsertTailList(ListHead, Entry)
VOID AddEntry(__in FxCollectionEntry *Node, __in FxObject *Item)
_Must_inspect_result_ FxCollectionEntry * AllocateEntry(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

Referenced by FxCollection::Add().

◆ AddEntry()

VOID FxCollectionInternal::AddEntry ( __in FxCollectionEntry Node,
__in FxObject Item 
)
inlineprotected

Definition at line 175 of file fxcollection.hpp.

179 {
180 Node->m_Object = Item;
181
182 //
183 // Refcount the item we are adding to the list.
184 //
185 Item->ADDREF(this);
186
187 //
188 // Increment the number of items in the collection.
189 //
190 m_Count++;
191 }
Definition: dlist.c:348

Referenced by Add(), and FxResourceCollection::AddAt().

◆ AllocateEntry()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::AllocateEntry ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)
inlineprotected

Definition at line 167 of file fxcollection.hpp.

170 {
171 return new(FxDriverGlobals) FxCollectionEntry();
172 }

Referenced by Add(), and FxResourceCollection::AddAt().

◆ CleanupEntry()

VOID FxCollectionInternal::CleanupEntry ( __in FxCollectionEntry Entry)

Definition at line 161 of file fxcollection.cpp.

164{
165 RemoveEntryList(&Entry->m_ListEntry);
166 delete Entry;
167
168 m_Count--;
169}
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
base of all file and directory entries
Definition: entries.h:83

Referenced by if(), and RemoveEntry().

◆ CleanupEntryObject()

VOID FxCollectionInternal::CleanupEntryObject ( __in FxObject Object)
inline

Definition at line 123 of file fxcollection.hpp.

126 {
127 Object->RELEASE(this);
128 }
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by if(), and RemoveEntry().

◆ Clear()

VOID FxCollectionInternal::Clear ( VOID  )

Definition at line 44 of file fxcollection.cpp.

47{
48 while (!IsListEmpty(&m_ListHead)) {
49 Remove(0);
50 }
51}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
_In_ BOOLEAN Remove
Definition: psfuncs.h:110

◆ Count()

◆ End()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::End ( VOID  )
inline

Definition at line 152 of file fxcollection.hpp.

155 {
156 return CONTAINING_RECORD(&m_ListHead, FxCollectionEntry, m_ListEntry);
157 }
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by FxResourceCollection::AddAt(), FxCmResList::CreateWdmList(), FxIoResReqList::CreateWdmList(), FxPkgPnp::PnpMatchResources(), and FxPkgPnp::ValidateCmResource().

◆ FindEntry()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::FindEntry ( __in ULONG  Index)

Definition at line 82 of file fxcollection.cpp.

85{
87 ULONG i;
88
89 if (Index >= m_Count) {
90 return NULL;
91 }
92
93 for (i = 0, ple = m_ListHead.Flink;
94 ple != &m_ListHead;
95 ple = ple->Flink, i++) {
96 if (i != Index) {
97 continue;
98 }
99
100 return CONTAINING_RECORD(ple, FxCollectionEntry, m_ListEntry);
101 }
102
103 return NULL;
104}
PSINGLE_LIST_ENTRY ple
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: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by GetItem(), Remove(), and FxResourceCollection::RemoveAndDelete().

◆ FindEntryByObject()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::FindEntryByObject ( __in FxObject Object)

Definition at line 108 of file fxcollection.cpp.

111{
113
114 for (ple = m_ListHead.Flink; ple != &m_ListHead; ple = ple->Flink) {
115 FxCollectionEntry* pNode;
116
117 pNode = CONTAINING_RECORD(ple, FxCollectionEntry, m_ListEntry);
118 if (pNode->m_Object == Object) {
119 return pNode;
120 }
121 }
122
123 return NULL;
124}
FxObject * m_Object

Referenced by RemoveItem().

◆ GetFirstItem()

_Must_inspect_result_ FxObject * FxCollectionInternal::GetFirstItem ( VOID  )

Definition at line 202 of file fxcollection.cpp.

205{
206 if (IsListEmpty(&m_ListHead)) {
207 return NULL;
208 }
209 else {
212 m_ListEntry)->m_Object;
213 }
214}

◆ GetItem()

_Must_inspect_result_ FxObject * FxCollectionInternal::GetItem ( __in ULONG  Index)

Definition at line 184 of file fxcollection.cpp.

188{
189 FxCollectionEntry* pNode;
190
191 pNode = FindEntry(Index);
192 if (pNode != NULL) {
193 return pNode->m_Object;
194 }
195 else {
196 return NULL;
197 }
198}
_Must_inspect_result_ FxCollectionEntry * FindEntry(__in ULONG Index)

Referenced by FxCmResList::GetDescriptor().

◆ GetLastItem()

_Must_inspect_result_ FxObject * FxCollectionInternal::GetLastItem ( VOID  )

Definition at line 218 of file fxcollection.cpp.

221{
222 if (IsListEmpty(&m_ListHead)) {
223 return NULL;
224 }
225 else {
228 m_ListEntry)->m_Object;
229 }
230}
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122

◆ Remove()

NTSTATUS FxCollectionInternal::Remove ( __in ULONG  Index)

Definition at line 127 of file fxcollection.cpp.

130{
131 FxCollectionEntry *pNode;
132
133 pNode = FindEntry(Index);
134
135 if (pNode != NULL) {
136 return RemoveEntry(pNode);
137 }
138 else {
139 return STATUS_NOT_FOUND;
140 }
141}
#define STATUS_NOT_FOUND
Definition: shellext.h:72
NTSTATUS RemoveEntry(__in FxCollectionEntry *Entry)

◆ RemoveEntry()

NTSTATUS FxCollectionInternal::RemoveEntry ( __in FxCollectionEntry Entry)

Definition at line 172 of file fxcollection.cpp.

175{
176 CleanupEntryObject(Entry->m_Object);
178
179 return STATUS_SUCCESS;
180}
#define STATUS_SUCCESS
Definition: shellext.h:65
VOID CleanupEntry(__in FxCollectionEntry *Entry)
VOID CleanupEntryObject(__in FxObject *Object)

Referenced by Remove(), FxResourceCollection::RemoveAndDelete(), RemoveItem(), and while().

◆ RemoveItem()

_Must_inspect_result_ NTSTATUS FxCollectionInternal::RemoveItem ( __in FxObject Item)

Definition at line 145 of file fxcollection.cpp.

148{
149 FxCollectionEntry* pNode;
150
151 pNode = FindEntryByObject(Item);
152
153 if (pNode != NULL) {
154 return RemoveEntry(pNode);
155 }
156
157 return STATUS_NOT_FOUND;
158}
_Must_inspect_result_ FxCollectionEntry * FindEntryByObject(__in FxObject *Object)

◆ Start()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::Start ( VOID  )
inline

Member Data Documentation

◆ m_Count

ULONG FxCollectionInternal::m_Count
protected

◆ m_ListHead


The documentation for this struct was generated from the following files: