@@ -28,34 +28,34 @@ #import "OFCollection.h" #import "OFSerialization.h" OF_ASSUME_NONNULL_BEGIN -/*! @file */ +/** @file */ @class OFArray OF_GENERIC(ObjectType); #ifdef OF_HAVE_BLOCKS -/*! +/** * @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 (^of_set_enumeration_block_t)(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 (^of_set_filter_block_t)(id object); #endif -/*! +/** * @class OFSet OFSet.h ObjFW/OFSet.h * * @brief An abstract class for an unordered set of unique objects. * * @warning Do not mutate objects that are in a set! Changing the hash of @@ -67,96 +67,96 @@ @interface OFSet OF_GENERIC(ObjectType): OFObject #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif -/*! +/** * @brief An array of all objects in the set. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; -/*! +/** * @brief An arbitrary object in the set. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType anyObject; -/*! +/** * @brief Creates a new set. * * @return A new, autoreleased set */ + (instancetype)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 */ + (instancetype)setWithSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @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 */ + (instancetype)setWithArray: (OFArray OF_GENERIC(ObjectType) *)array; -/*! +/** * @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 */ + (instancetype)setWithObjects: (ObjectType)firstObject, ...; -/*! +/** * @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 */ + (instancetype)setWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; -/*! +/** * @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 */ - (instancetype)initWithSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @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 */ - (instancetype)initWithArray: (OFArray OF_GENERIC(ObjectType) *)array; -/*! +/** * @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 */ - (instancetype)initWithObjects: (ObjectType)firstObject, ... OF_SENTINEL; -/*! +/** * @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 */ - (instancetype)initWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; -/*! +/** * @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 @@ -163,63 +163,63 @@ * @return An initialized set with the specified object and va_list */ - (instancetype)initWithObject: (ObjectType)firstObject arguments: (va_list)arguments; -/*! +/** * @brief Returns whether the receiver is a subset of the specified set. * * @return Whether the receiver is a subset of the specified set */ - (bool)isSubsetOfSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @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 * in common */ - (bool)intersectsSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @brief Creates a new set which contains the objects which are in the * receiver, but not in the specified set. * * @param set The set whose objects will not be in the new set */ - (OFSet OF_GENERIC(ObjectType) *)setBySubtractingSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @brief Creates a new set by creating the intersection of the receiver and * the specified set. * * @param set The set to intersect with */ - (OFSet OF_GENERIC(ObjectType) *)setByIntersectingWithSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @brief Creates a new set by creating the union of the receiver and the * specified set. * * @param set The set to create the union with */ - (OFSet OF_GENERIC(ObjectType) *)setByAddingSet: (OFSet OF_GENERIC(ObjectType) *)set; -/*! +/** * @brief Checks whether the set contains an object equal to the specified * object. * * @param object The object which is checked for being in the set * @return A boolean whether the set contains the specified object */ - (bool)containsObject: (ObjectType)object; -/*! +/** * @brief Returns the value for the specified key * * A new set with the value for the specified key for each object is returned. * * The special key `@count` can be used to retrieve the count as an OFNumber. @@ -229,11 +229,11 @@ * @param key The key of the value to return * @return The value for the specified key */ - (nullable id)valueForKey: (OFString *)key; -/*! +/** * @brief Set the value for the specified key * * @ref setValue:forKey: is called for each object. * * @note A @ref OFNull value is translated to nil! @@ -243,18 +243,18 @@ */ - (void)setValue: (nullable id)value forKey: (OFString *)key; #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: (of_set_enumeration_block_t)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