ObjFW
OFMutableSet.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
3  * Jonathan Schleifer <js@webkeks.org>
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 #ifdef OF_HAVE_GENERICS
27 @interface OFMutableSet <ObjectType>: OFSet <ObjectType>
28 #else
29 # ifndef DOXYGEN
30 # define ObjectType id
31 # endif
32 @interface OFMutableSet: OFSet
33 #endif
34 
39 - (void)addObject: (ObjectType)object;
40 
46 - (void)removeObject: (ObjectType)object;
47 
53 - (void)minusSet: (OFSet OF_GENERIC(ObjectType)*)set;
54 
61 - (void)intersectSet: (OFSet OF_GENERIC(ObjectType)*)set;
62 
68 - (void)unionSet: (OFSet OF_GENERIC(ObjectType)*)set;
69 
73 - (void)makeImmutable;
74 @end
75 #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
76 # undef ObjectType
77 #endif
78 
79 OF_ASSUME_NONNULL_END
An abstract class for a mutable unordered set of unique objects.
Definition: OFMutableSet.h:32
An abstract class for an unordered set of unique objects.
Definition: OFSet.h:69
void makeImmutable()
Converts the mutable set to an immutable set.
Definition: OFMutableSet.m:201
instancetype set()
Creates a new set.
Definition: OFSet.m:120