ObjFW
OFMutableSet.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFSet.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
26 @interface OFMutableSet OF_GENERIC(ObjectType): OFSet OF_GENERIC(ObjectType)
27 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
28 # define ObjectType id
29 #endif
30 
37 + (instancetype)setWithCapacity: (size_t)capacity;
38 
46 - initWithCapacity: (size_t)capacity;
47 
53 - (void)addObject: (ObjectType)object;
54 
60 - (void)removeObject: (ObjectType)object;
61 
67 - (void)minusSet: (OFSet OF_GENERIC(ObjectType) *)set;
68 
75 - (void)intersectSet: (OFSet OF_GENERIC(ObjectType) *)set;
76 
82 - (void)unionSet: (OFSet OF_GENERIC(ObjectType) *)set;
83 
87 - (void)makeImmutable;
88 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
89 # undef ObjectType
90 #endif
91 @end
92 
93 OF_ASSUME_NONNULL_END
An abstract class for an unordered set of unique objects.
Definition: OFSet.h:63
void makeImmutable()
Converts the mutable set to an immutable set.
Definition: OFMutableSet.m:202
An abstract class for a mutable unordered set of unique objects.
Definition: OFMutableSet.h:26