ObjFW
Loading...
Searching...
No Matches
OFCountedSet.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This file is part of ObjFW. It may be distributed under the terms of the
7 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8 * the packaging of this file.
9 *
10 * Alternatively, it may be distributed under the terms of the GNU General
11 * Public License, either version 2 or 3, which can be found in the file
12 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13 * file.
14 */
15
16#import "OFSet.h"
17
18OF_ASSUME_NONNULL_BEGIN
19
22#ifdef OF_HAVE_BLOCKS
31typedef void (^OFCountedSetEnumerationBlock)(id object, size_t count,
32 bool *stop);
33#endif
34
44@interface OFCountedSet OF_GENERIC(ObjectType):
45 OFMutableSet OF_GENERIC(ObjectType)
46#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
47# define ObjectType id
48#endif
54- (size_t)countForObject: (ObjectType)object;
55
56#ifdef OF_HAVE_BLOCKS
62- (void)enumerateObjectsAndCountUsingBlock: (OFCountedSetEnumerationBlock)block;
63#endif
64#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
65# undef ObjectType
66#endif
67@end
68
69OF_ASSUME_NONNULL_END
void(^ OFCountedSetEnumerationBlock)(id object, size_t count, bool *stop)
A block for enumerating an OFCountedSet.
Definition OFCountedSet.h:31
An abstract class for a mutable unordered set of objects, counting how often it contains an object.
Definition OFCountedSet.h:46
An abstract class for a mutable unordered set of unique objects.
Definition OFMutableSet.h:29