@@ -35,17 +35,24 @@ * @class OFCountedSet OFCountedSet.h ObjFW/OFCountedSet.h * * @brief An abstract class for a mutable unordered set of objects, counting how * often it contains an object. */ +#ifdef OF_HAVE_GENERICS +@interface OFCountedSet : OFMutableSet +#else +# ifndef DOXYGEN +# define ObjectType id +# endif @interface OFCountedSet: OFMutableSet +#endif /*! * @brief Returns how often the object is in the set. * * @return How often the object is in the set */ -- (size_t)countForObject: (id)object; +- (size_t)countForObject: (ObjectType)object; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each object in the set. * @@ -53,5 +60,8 @@ */ - (void)enumerateObjectsAndCountUsingBlock: (of_counted_set_enumeration_block_t)block; #endif @end +#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) +# undef ObjectType +#endif