TianoCore EDK2 master
Loading...
Searching...
No Matches
OrderedCollectionLib.h
Go to the documentation of this file.
1
12#ifndef __ORDERED_COLLECTION_LIB__
13#define __ORDERED_COLLECTION_LIB__
14
15#include <Base.h>
16
17//
18// Opaque structure for a collection.
19//
21
22//
23// Opaque structure for collection entries.
24//
25// Collection entries do not take ownership of the associated user structures,
26// they only link them. This makes it easy to link the same user structure into
27// several collections. If reference counting is required, the caller is
28// responsible for implementing it, as part of the user structure.
29//
30// A pointer-to-ORDERED_COLLECTION_ENTRY is considered an "iterator". Multiple,
31// simultaneous iterations are supported.
32//
34
35//
36// Altering the key field of an in-collection user structure (ie. the portion
37// of the user structure that ORDERED_COLLECTION_USER_COMPARE and
38// ORDERED_COLLECTION_KEY_COMPARE, below, read) is not allowed in-place. The
39// caller is responsible for bracketing the key change with the deletion and
40// the reinsertion of the user structure, so that the changed key value is
41// reflected in the collection.
42//
43
57typedef
60 IN CONST VOID *UserStruct1,
61 IN CONST VOID *UserStruct2
62 );
63
78typedef
81 IN CONST VOID *StandaloneKey,
82 IN CONST VOID *UserStruct
83 );
84
85//
86// Some functions below are read-only, while others are read-write. If any
87// write operation is expected to run concurrently with any other operation on
88// the same collection, then the caller is responsible for implementing locking
89// for the whole collection.
90//
91
103VOID *
104EFIAPI
107 );
108
127EFIAPI
129 IN ORDERED_COLLECTION_USER_COMPARE UserStructCompare,
131 );
132
144BOOLEAN
145EFIAPI
147 IN CONST ORDERED_COLLECTION *Collection
148 );
149
160VOID
161EFIAPI
163 IN ORDERED_COLLECTION *Collection
164 );
165
184EFIAPI
186 IN CONST ORDERED_COLLECTION *Collection,
187 IN CONST VOID *StandaloneKey
188 );
189
206EFIAPI
208 IN CONST ORDERED_COLLECTION *Collection
209 );
210
228EFIAPI
230 IN CONST ORDERED_COLLECTION *Collection
231 );
232
248EFIAPI
251 );
252
268EFIAPI
271 );
272
334RETURN_STATUS
335EFIAPI
337 IN OUT ORDERED_COLLECTION *Collection,
338 OUT ORDERED_COLLECTION_ENTRY **Entry OPTIONAL,
339 IN VOID *UserStruct
340 );
341
400VOID
401EFIAPI
403 IN OUT ORDERED_COLLECTION *Collection,
405 OUT VOID **UserStruct OPTIONAL
406 );
407
408#endif
INT64 INTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
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)
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)
INTN(EFIAPI * ORDERED_COLLECTION_KEY_COMPARE)(IN CONST VOID *StandaloneKey, IN CONST VOID *UserStruct)