GNUstep CoreBase Library 0.2
CFBinaryHeap.h
1/* CFBinaryHeap.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: December, 2011
7
8 This file is part of the GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFBINARYHEAP_H__
28#define __COREFOUNDATION_CFBINARYHEAP_H__
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
33
37typedef struct __CFBinaryHeap *CFBinaryHeapRef;
38
39typedef void (*CFBinaryHeapApplierFunction) (const void *val, void *context);
40
41typedef const void *(*CFBinaryHeapRetainCallBack) (CFAllocatorRef allocator,
42 const void *ptr);
43typedef void (*CFBinaryHeapReleaseCallBack) (CFAllocatorRef allocator,
44 const void *ptr);
45typedef CFStringRef (*CFBinaryHeapCopyDescriptionCallBack) (const void *ptr);
46typedef CFComparisonResult (*CFBinaryHeapCompareCallBack) (const void *ptr1,
47 const void *ptr2, void *info);
48
51{
52 CFIndex version;
53 CFBinaryHeapRetainCallBack retain;
54 CFBinaryHeapReleaseCallBack release;
55 CFAllocatorCopyDescriptionCallBack copyDescription;
56 CFBinaryHeapCompareCallBack compare;
57};
58
61{
62 CFIndex version;
63 void *info;
64 CFAllocatorRetainCallBack retain;
65 CFAllocatorReleaseCallBack release;
66 CFAllocatorCopyDescriptionCallBack copyDescription;
67};
68
69CF_EXPORT const CFBinaryHeapCallBacks kCFStringBinaryHeapCallBacks;
70
71
72
73CF_EXPORT CFBinaryHeapRef
74CFBinaryHeapCreate (CFAllocatorRef allocator, CFIndex capacity,
75 const CFBinaryHeapCallBacks *callBacks,
76 const CFBinaryHeapCompareContext *compareContext);
77
78CF_EXPORT CFBinaryHeapRef
79CFBinaryHeapCreateCopy (CFAllocatorRef allocator, CFIndex capacity,
80 CFBinaryHeapRef heap);
81
82CF_EXPORT void
83CFBinaryHeapAddValue (CFBinaryHeapRef heap, const void *value);
84
85CF_EXPORT void
86CFBinaryHeapApplyFunction (CFBinaryHeapRef heap,
87 CFBinaryHeapApplierFunction applier, void *context);
88
89CF_EXPORT Boolean
90CFBinaryHeapContainsValue (CFBinaryHeapRef heap, const void *value);
91
92CF_EXPORT CFIndex
93CFBinaryHeapGetCount (CFBinaryHeapRef heap);
94
95CF_EXPORT CFIndex
96CFBinaryHeapGetCountOfValue (CFBinaryHeapRef heap, const void *value);
97
98CF_EXPORT const void *
99CFBinaryHeapGetMinimum (CFBinaryHeapRef heap);
100
101CF_EXPORT Boolean
102CFBinaryHeapGetMinimumIfPresent (CFBinaryHeapRef heap, const void **value);
103
104CF_EXPORT void
105CFBinaryHeapGetValues (CFBinaryHeapRef heap, const void **values);
106
107CF_EXPORT void
108CFBinaryHeapRemoveAllValues (CFBinaryHeapRef heap);
109
110CF_EXPORT void
111CFBinaryHeapRemoveMinimumValue (CFBinaryHeapRef heap);
112
113CF_EXPORT CFTypeID
114CFBinaryHeapGetTypeID (void);
115
118CF_EXTERN_C_END
119
120#endif /* __COREFOUNDATION_CFBINARYHEAP_H__ */
121
signed long CFIndex
Definition CFBase.h:165
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
Definition CFBinaryHeap.h:51
Definition CFBinaryHeap.h:61