XenevaOS
Loading...
Searching...
No Matches
OrderedCollectionLib.h
Go to the documentation of this file.
1
18#ifndef __ORDERED_COLLECTION_LIB__
19#define __ORDERED_COLLECTION_LIB__
20
21#include <Base.h>
22
23//
24// Opaque structure for a collection.
25//
27
28//
29// Opaque structure for collection entries.
30//
31// Collection entries do not take ownership of the associated user structures,
32// they only link them. This makes it easy to link the same user structure into
33// several collections. If reference counting is required, the caller is
34// responsible for implementing it, as part of the user structure.
35//
36// A pointer-to-ORDERED_COLLECTION_ENTRY is considered an "iterator". Multiple,
37// simultaneous iterations are supported.
38//
40
41//
42// Altering the key field of an in-collection user structure (ie. the portion
43// of the user structure that ORDERED_COLLECTION_USER_COMPARE and
44// ORDERED_COLLECTION_KEY_COMPARE, below, read) is not allowed in-place. The
45// caller is responsible for bracketing the key change with the deletion and
46// the reinsertion of the user structure, so that the changed key value is
47// reflected in the collection.
48//
49
63typedef
66 IN CONST VOID *UserStruct1,
67 IN CONST VOID *UserStruct2
68 );
69
84typedef
87 IN CONST VOID *StandaloneKey,
88 IN CONST VOID *UserStruct
89 );
90
91
92//
93// Some functions below are read-only, while others are read-write. If any
94// write operation is expected to run concurrently with any other operation on
95// the same collection, then the caller is responsible for implementing locking
96// for the whole collection.
97//
98
110VOID *
111EFIAPI
114 );
115
116
135EFIAPI
137 IN ORDERED_COLLECTION_USER_COMPARE UserStructCompare,
139 );
140
141
154EFIAPI
156 IN CONST ORDERED_COLLECTION *Collection
157 );
158
159
170VOID
171EFIAPI
173 IN ORDERED_COLLECTION *Collection
174 );
175
176
195EFIAPI
197 IN CONST ORDERED_COLLECTION *Collection,
198 IN CONST VOID *StandaloneKey
199 );
200
201
218EFIAPI
220 IN CONST ORDERED_COLLECTION *Collection
221 );
222
223
241EFIAPI
243 IN CONST ORDERED_COLLECTION *Collection
244 );
245
246
262EFIAPI
265 );
266
267
283EFIAPI
286 );
287
288
351EFIAPI
353 IN OUT ORDERED_COLLECTION *Collection,
355 IN VOID *UserStruct
356 );
357
358
417VOID
418EFIAPI
420 IN OUT ORDERED_COLLECTION *Collection,
422 OUT VOID **UserStruct OPTIONAL
423 );
424
425#endif
#define EFIAPI
Definition ProcessorBind.h:172
#define CONST
Definition Base.h:327
#define IN
Definition Base.h:347
UINTN RETURN_STATUS
Definition Base.h:965
#define OUT
Definition Base.h:352
#define OPTIONAL
Definition Base.h:358
ORDERED_COLLECTION_ENTRY *EFIAPI OrderedCollectionFind(IN CONST ORDERED_COLLECTION *Collection, IN CONST VOID *StandaloneKey)
ORDERED_COLLECTION_ENTRY *EFIAPI OrderedCollectionPrev(IN CONST ORDERED_COLLECTION_ENTRY *Entry)
ORDERED_COLLECTION_ENTRY *EFIAPI OrderedCollectionMax(IN CONST ORDERED_COLLECTION *Collection)
struct ORDERED_COLLECTION ORDERED_COLLECTION
Definition OrderedCollectionLib.h:26
ORDERED_COLLECTION_ENTRY *EFIAPI OrderedCollectionMin(IN CONST ORDERED_COLLECTION *Collection)
VOID *EFIAPI OrderedCollectionUserStruct(IN CONST ORDERED_COLLECTION_ENTRY *Entry)
RETURN_STATUS EFIAPI OrderedCollectionInsert(IN OUT ORDERED_COLLECTION *Collection, OUT ORDERED_COLLECTION_ENTRY **Entry OPTIONAL, IN VOID *UserStruct)
VOID EFIAPI OrderedCollectionUninit(IN ORDERED_COLLECTION *Collection)
ORDERED_COLLECTION *EFIAPI OrderedCollectionInit(IN ORDERED_COLLECTION_USER_COMPARE UserStructCompare, IN ORDERED_COLLECTION_KEY_COMPARE KeyCompare)
ORDERED_COLLECTION_ENTRY *EFIAPI OrderedCollectionNext(IN CONST ORDERED_COLLECTION_ENTRY *Entry)
VOID EFIAPI OrderedCollectionDelete(IN OUT ORDERED_COLLECTION *Collection, IN ORDERED_COLLECTION_ENTRY *Entry, OUT VOID **UserStruct OPTIONAL)
BOOLEAN EFIAPI OrderedCollectionIsEmpty(IN CONST ORDERED_COLLECTION *Collection)
INTN(EFIAPI * ORDERED_COLLECTION_USER_COMPARE)(IN CONST VOID *UserStruct1, IN CONST VOID *UserStruct2)
Definition OrderedCollectionLib.h:65
INTN(EFIAPI * ORDERED_COLLECTION_KEY_COMPARE)(IN CONST VOID *StandaloneKey, IN CONST VOID *UserStruct)
Definition OrderedCollectionLib.h:86
struct ORDERED_COLLECTION_ENTRY ORDERED_COLLECTION_ENTRY
Definition OrderedCollectionLib.h:39
#define VOID
Definition acefi.h:190
#define INTN
Definition acefi.h:223
unsigned char BOOLEAN
Definition actypes.h:235