00001 /* 00002 * Copyright (c) 2008 - 2010 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE included in 00009 * the packaging of this file. 00010 */ 00011 00012 #import "OFObject.h" 00013 00017 @interface OFEnumerator: OFObject {} 00021 - (id)nextObject; 00022 00027 - reset; 00028 @end 00029 00030 /* 00031 * This needs to be exactly like this because it's hardcoded in the compiler. 00032 * 00033 * We need this bad check to see if we already imported Cocoa, which defines 00034 * this as well. 00035 */ 00036 #define of_fast_enumeration_state_t NSFastEnumerationState 00037 #ifndef NSINTEGER_DEFINED 00038 00041 typedef struct __of_fast_enumeration_state { 00043 unsigned long state; 00045 id *itemsPtr; 00047 unsigned long *mutationsPtr; 00049 unsigned long extra[5]; 00050 } of_fast_enumeration_state_t; 00051 #endif 00052 00059 @protocol OFFastEnumeration 00060 - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state 00061 objects: (id*)objects 00062 count: (int)count; 00063 @end