ObjFW
 All Classes Functions Variables
OFSet.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012
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 #ifndef __STDC_LIMIT_MACROS
18 # define __STDC_LIMIT_MACROS
19 #endif
20 #ifndef __STDC_CONSTANT_MACROS
21 # define __STDC_CONSTANT_MACROS
22 #endif
23 
24 #include <stdarg.h>
25 
26 #import "OFObject.h"
27 #import "OFCollection.h"
28 #import "OFSerialization.h"
29 
30 @class OFArray;
31 
32 #ifdef OF_HAVE_BLOCKS
33 typedef void (^of_set_enumeration_block_t)(id object, BOOL *stop);
34 typedef BOOL (^of_set_filter_block_t)(id object);
35 #endif
36 
47 + (instancetype)set;
48 
55 + (instancetype)setWithSet: (OFSet*)set;
56 
63 + (instancetype)setWithArray: (OFArray*)array;
64 
71 + (instancetype)setWithObjects: (id)firstObject, ...;
72 
80 + (instancetype)setWithObjects: (id const*)objects
81  count: (size_t)count;
82 
89 - initWithSet: (OFSet*)set;
90 
97 - initWithArray: (OFArray*)array;
98 
105 - initWithObjects: (id)firstObject, ...;
106 
114 - initWithObjects: (id const*)objects
115  count: (size_t)count;
116 
125 - initWithObject: (id)firstObject
126  arguments: (va_list)arguments;
127 
133 - (BOOL)isSubsetOfSet: (OFSet*)set;
134 
142 - (BOOL)intersectsSet: (OFSet*)set;
143 
144 #ifdef OF_HAVE_BLOCKS
145 
150 - (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;
151 
159 - (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block;
160 #endif
161 @end
162 
163 #import "OFMutableSet.h"