ReactOS 0.4.15-dev-7907-g95bf896
fxcollection.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxCollection.hpp
8
9Abstract:
10
11 This module implements a simple collection class to operate on
12 objects derived from FxObject.
13
14Author:
15
16
17
18Environment:
19
20 Both kernel and user mode
21
22Revision History:
23
24--*/
25
26#ifndef _FXCOLLECTION_HPP_
27#define _FXCOLLECTION_HPP_
28
29class FxCollectionEntry : public FxStump {
30
33
34protected:
36 VOID
37 )
38 {
39 }
40
41public:
43
45
46public:
49 VOID
50 )
51 {
53 }
54};
55
57protected:
59
61
62public:
64 VOID
65 );
66
68 VOID
69 );
70
75 );
76
81 );
82
83 ULONG
84 Count(
85 VOID
86 );
87
89 Add(
90 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
92 );
93
95 FxObject *
96 GetItem(
98 );
99
101 FxObject*
103 VOID
104 );
105
107 FxObject*
109 VOID
110 );
111
113 Remove(
115 );
116
117 VOID
120 );
121
122 VOID
125 )
126 {
127 Object->RELEASE(this);
128 }
129
133 );
134
139 );
140
144 VOID
145 )
146 {
148 }
149
153 VOID
154 )
155 {
156 return CONTAINING_RECORD(&m_ListHead, FxCollectionEntry, m_ListEntry);
157 }
158
159 VOID
160 Clear(
161 VOID
162 );
163
164protected:
168 __in PFX_DRIVER_GLOBALS FxDriverGlobals
169 )
170 {
171 return new(FxDriverGlobals) FxCollectionEntry();
172 }
173
174 VOID
178 )
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 }
192};
193
195
196public:
198 __in PFX_DRIVER_GLOBALS FxDriverGlobals
199 );
200
202 VOID
203 );
204
205 BOOLEAN
208 )
209 {
211 }
212
213 VOID
216 );
217
218protected:
220 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
223 );
224
225};
226
227#endif // _FXCOLLECTION_HPP_
unsigned char BOOLEAN
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
FxObject * m_Object
friend FxCollectionInternal
FxCollectionEntry * Next(VOID)
LIST_ENTRY m_ListEntry
VOID StealCollection(__in FxCollection *Collection)
BOOLEAN Add(__in FxObject *Item)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define __in
Definition: dbghelp.h:35
USHORT WDFTYPE
Definition: fxtypes.h:29
static void Clear(void)
Definition: treeview.c:386
#define _Must_inspect_result_
Definition: ms_sal.h:558
int Count
Definition: noreturn.cpp:7
unsigned short USHORT
Definition: pedump.c:61
base of all file and directory entries
Definition: entries.h:83
_Must_inspect_result_ FxCollectionEntry * FindEntry(__in ULONG Index)
_Must_inspect_result_ FxCollectionEntry * Start(VOID)
VOID CleanupEntry(__in FxCollectionEntry *Entry)
NTSTATUS RemoveEntry(__in FxCollectionEntry *Entry)
_Must_inspect_result_ NTSTATUS RemoveItem(__in FxObject *Item)
_Must_inspect_result_ FxObject * GetLastItem(VOID)
VOID AddEntry(__in FxCollectionEntry *Node, __in FxObject *Item)
_Must_inspect_result_ FxObject * GetItem(__in ULONG Index)
BOOLEAN Add(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Item)
_Must_inspect_result_ FxCollectionEntry * End(VOID)
_Must_inspect_result_ FxCollectionEntry * FindEntryByObject(__in FxObject *Object)
_Must_inspect_result_ FxObject * GetFirstItem(VOID)
VOID CleanupEntryObject(__in FxObject *Object)
_Must_inspect_result_ FxCollectionEntry * AllocateEntry(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ WDFCOLLECTION Collection
Definition: wdfregistry.h:374
_In_ BOOLEAN Remove
Definition: psfuncs.h:110