Differences From Artifact [14327ba57e]:
- File
src/OFSet.h
— part of check-in
[f0f38b0f42]
at
2021-04-07 20:52:00
on branch trunk
— Override -[objectEnumerator] in some classes
Classes using lightweight generics should also use them for the
enumerator to allow stronger typing. (user: js, size: 8017) [annotate] [blame] [check-ins using] [more...]
To Artifact [b05430c060]:
- File src/OFSet.h — part of check-in [c4e0e56fa3] at 2021-04-17 03:21:14 on branch new-naming-convention — Rename all blocks (user: js, size: 7998) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
36 37 38 39 40 41 42 | /** * @brief A block for enumerating an OFSet. * * @param object The current object * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ | | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | /** * @brief A block for enumerating an OFSet. * * @param object The current object * @param stop A pointer to a variable that can be set to true to stop the * enumeration */ typedef void (^OFSetEnumerationBlock)(id object, bool *stop); /** * @brief A block for filtering an OFSet. * * @param object The object to inspect * @return Whether the object should be in the filtered set */ typedef bool (^OFSetFilterBlock)(id object); #endif /** * @class OFSet OFSet.h ObjFW/OFSet.h * * @brief An abstract class for an unordered set of unique objects. * |
︙ | ︙ | |||
250 251 252 253 254 255 256 | #ifdef OF_HAVE_BLOCKS /** * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set */ | | | | | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | #ifdef OF_HAVE_BLOCKS /** * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set */ - (void)enumerateObjectsUsingBlock: (OFSetEnumerationBlock)block; /** * @brief Creates a new set, only containing the objects for which the block * returns true. * * @param block A block which determines if the object should be in the new set * @return A new, autoreleased OFSet */ - (OFSet OF_GENERIC(ObjectType) *) filteredSetUsingBlock: (OFSetFilterBlock)block; #endif #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif @end OF_ASSUME_NONNULL_END #import "OFMutableSet.h" |