@@ -8,10 +8,12 @@ * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #import "OFObject.h" +#import "OFCollection.h" +#import "OFEnumerator.h" /** * \brief A list object. * * A struct that contains a pointer to the next list object, the previous list @@ -27,21 +29,21 @@ } of_list_object_t; /** * \brief A class which provides easy to use double-linked lists. */ -@interface OFList: OFObject +@interface OFList: OFObject { of_list_object_t *firstListObject; of_list_object_t *lastListObject; size_t count; + unsigned long mutations; } #ifdef OF_HAVE_PROPERTIES @property (readonly) of_list_object_t *firstListObject; @property (readonly) of_list_object_t *lastListObject; -@property (readonly) size_t count; #endif /** * \return A new autoreleased OFList */ @@ -105,11 +107,20 @@ * Removes the object with the specified list object from the list. * * \param listobj The list object returned by append / prepend */ - (void)removeListObject: (of_list_object_t*)listobj; +@end + +/// \cond internal +@interface OFListEnumerator: OFEnumerator +{ + of_list_object_t *first; + of_list_object_t *current; + unsigned long mutations; + unsigned long *mutationsPtr; +} -/** - * \return The number of items in the list. - */ -- (size_t)count; +- initWithFirstListObject: (of_list_object_t*)first + mutationsPointer: (unsigned long*)mutations_ptr; @end +/// \endcond