ObjFW  Diff

Differences From Artifact [e720d47024]:

To Artifact [45f4477f95]:


30
31
32
33
34
35
36
37
38


39
40
41
42
43


44
45

46
47
48
49
50


51
52
53


54
55
56
57
58


59
60
61


62
63
64
65
66


67
68
69


70
71
72
73
74


75
76
77
78



79
80
81
82
83
84


85
86
87


88
89
90
91
92


93
94
95


96
97
98
99
100


101
102
103


104
105
106
107
108


109
110
111
112



113
114
115
116
117
118


119
120
121
122
123



124
125
126
127
128
129


130
131

132
133
134
135
136


137
138
139

140
141
142
143
144
145
146


147
148

149
150
151
152
153


154
155
156
157


158
159
160
161
162
163
30
31
32
33
34
35
36


37
38
39
40
41


42
43
44

45
46
47
48


49
50
51


52
53
54
55
56


57
58
59


60
61
62
63
64


65
66
67


68
69
70
71
72


73
74
75



76
77
78
79
80
81
82


83
84
85


86
87
88
89
90


91
92
93


94
95
96
97
98


99
100
101


102
103
104
105
106


107
108
109



110
111
112
113
114
115
116


117
118
119
120



121
122
123
124
125
126
127


128
129
130

131
132
133
134


135
136
137
138

139
140
141
142
143
144


145
146
147

148
149
150
151


152
153
154
155


156
157
158
159
160
161
162
163







-
-
+
+



-
-
+
+

-
+



-
-
+
+

-
-
+
+



-
-
+
+

-
-
+
+



-
-
+
+

-
-
+
+



-
-
+
+

-
-
-
+
+
+




-
-
+
+

-
-
+
+



-
-
+
+

-
-
+
+



-
-
+
+

-
-
+
+



-
-
+
+

-
-
-
+
+
+




-
-
+
+


-
-
-
+
+
+




-
-
+
+

-
+



-
-
+
+


-
+





-
-
+
+

-
+



-
-
+
+


-
-
+
+






@class OFArray;

#ifdef OF_HAVE_BLOCKS
typedef void (^of_set_enumeration_block_t)(id object, BOOL *stop);
typedef BOOL (^of_set_filter_block_t)(id object);
#endif

/**
 * \brief An abstract class for an unordered set of unique objects.
/*!
 * @brief An abstract class for an unordered set of unique objects.
 */
@interface OFSet: OFObject <OFCollection, OFCopying, OFMutableCopying,
    OFSerialization>
/**
 * \brief Creates a new set.
/*!
 * @brief Creates a new set.
 *
 * \return A new, autoreleased set
 * @return A new, autoreleased set
 */
+ (instancetype)set;

/**
 * \brief Creates a new set with the specified set.
/*!
 * @brief Creates a new set with the specified set.
 *
 * \param set The set to initialize the set with
 * \return A new, autoreleased set with the specified set
 * @param set The set to initialize the set with
 * @return A new, autoreleased set with the specified set
 */
+ (instancetype)setWithSet: (OFSet*)set;

/**
 * \brief Creates a new set with the specified array.
/*!
 * @brief Creates a new set with the specified array.
 *
 * \param array The array to initialize the set with
 * \return A new, autoreleased set with the specified array
 * @param array The array to initialize the set with
 * @return A new, autoreleased set with the specified array
 */
+ (instancetype)setWithArray: (OFArray*)array;

/**
 * \brief Creates a new set with the specified objects.
/*!
 * @brief Creates a new set with the specified objects.
 *
 * \param firstObject The first object for the set
 * \return A new, autoreleased set with the specified objects
 * @param firstObject The first object for the set
 * @return A new, autoreleased set with the specified objects
 */
+ (instancetype)setWithObjects: (id)firstObject, ...;

/**
 * \brief Creates a new set with the specified objects.
/*!
 * @brief Creates a new set with the specified objects.
 *
 * \param objects An array of objects for the set
 * \param count The number of objects in the specified array
 * \return A new, autoreleased set with the specified objects
 * @param objects An array of objects for the set
 * @param count The number of objects in the specified array
 * @return A new, autoreleased set with the specified objects
 */
+ (instancetype)setWithObjects: (id const*)objects
			 count: (size_t)count;

/**
 * \brief Initializes an already allocated set with the specified set.
/*!
 * @brief Initializes an already allocated set with the specified set.
 *
 * \param set The set to initialize the set with
 * \return An initialized set with the specified set
 * @param set The set to initialize the set with
 * @return An initialized set with the specified set
 */
- initWithSet: (OFSet*)set;

/**
 * \brief Initializes an already allocated set with the specified array.
/*!
 * @brief Initializes an already allocated set with the specified array.
 *
 * \param array The array to initialize the set with
 * \return An initialized set with the specified array
 * @param array The array to initialize the set with
 * @return An initialized set with the specified array
 */
- initWithArray: (OFArray*)array;

/**
 * \brief Initializes an already allocated set with the specified objects.
/*!
 * @brief Initializes an already allocated set with the specified objects.
 *
 * \param firstObject The first object for the set
 * \return An initialized set with the specified objects
 * @param firstObject The first object for the set
 * @return An initialized set with the specified objects
 */
- initWithObjects: (id)firstObject, ...;

/**
 * \brief Initializes an already allocated set with the specified objects.
/*!
 * @brief Initializes an already allocated set with the specified objects.
 *
 * \param objects An array of objects for the set
 * \param count The number of objects in the specified array
 * \return An initialized set with the specified objects
 * @param objects An array of objects for the set
 * @param count The number of objects in the specified array
 * @return An initialized set with the specified objects
 */
- initWithObjects: (id const*)objects
	    count: (size_t)count;

/**
 * \brief Initializes an already allocated set with the specified object and
/*!
 * @brief Initializes an already allocated set with the specified object and
 *	  va_list.
 *
 * \param firstObject The first object for the set
 * \param arguments A va_list with the other objects
 * \return An initialized set with the specified object and va_list
 * @param firstObject The first object for the set
 * @param arguments A va_list with the other objects
 * @return An initialized set with the specified object and va_list
 */
- initWithObject: (id)firstObject
       arguments: (va_list)arguments;

/**
 * \brief Returns whether the receiver is a subset of the specified set.
/*!
 * @brief Returns whether the receiver is a subset of the specified set.
 *
 * \return Whether the receiver is a subset of the specified set
 * @return Whether the receiver is a subset of the specified set
 */
- (BOOL)isSubsetOfSet: (OFSet*)set;

/**
 * \brief Returns whether the receiver and the specified set have at least one
/*!
 * @brief Returns whether the receiver and the specified set have at least one
 *	  object in common.
 *
 * \return Whether the receiver and the specified set have at least one object
 * @return Whether the receiver and the specified set have at least one object
 *	   in common
 */
- (BOOL)intersectsSet: (OFSet*)set;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Executes a block for each object in the set.
/*!
 * @brief Executes a block for each object in the set.
 *
 * \param block The block to execute for each object in the set
 * @param block The block to execute for each object in the set
 */
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;

/**
 * \brief Creates a new set, only containing the objects for which the block
/*!
 * @brief Creates a new set, only containing the objects for which the block
 *	  returns YES.
 *
 * \param block A block which determines if the object should be in the new set
 * \return A new, autoreleased OFSet
 * @param block A block which determines if the object should be in the new set
 * @return A new, autoreleased OFSet
 */
- (OFSet*)filteredSetUsingBlock: (of_set_filter_block_t)block;
#endif
@end

#import "OFMutableSet.h"