ObjFW
 All Classes Functions Variables
OFEnumerator.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012
3  * Jonathan Schleifer <js@webkeks.org>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFObject.h"
18 
19 @class OFEnumerator;
20 
24 @protocol OFEnumerating
32 @end
33 
43 - (id)nextObject;
44 
49 - (void)reset;
50 @end
51 
52 /*
53  * This needs to be exactly like this because it's hardcoded in the compiler.
54  *
55  * We need this bad check to see if we already imported Cocoa, which defines
56  * this as well.
57  */
58 #define of_fast_enumeration_state_t NSFastEnumerationState
59 #ifndef NSINTEGER_DEFINED
60 
65  unsigned long state;
67  __unsafe_unretained id *itemsPtr;
69  unsigned long *mutationsPtr;
71  unsigned long extra[5];
73 #endif
74 
92 - (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
93  objects: (__unsafe_unretained id*)objects
94  count: (int)count;
95 @end