8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import "OFObject.h"
/**
* The OFEnumerator class provides methods to enumerate through collections.
*/
@interface OFEnumerator: OFObject {}
/**
* \return The next object
*/
- (id)nextObject;
|
|
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import "OFObject.h"
/**
* \brief A class which provides methods to enumerate through collections.
*/
@interface OFEnumerator: OFObject {}
/**
* \return The next object
*/
- (id)nextObject;
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
* This needs to be exactly like this because it's hardcoded in the compiler.
*
* We need this bad check to see if we already imported Cocoa, which defines
* this as well.
*/
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct __of_fast_enumeration_state {
/// Arbitrary state information for the enumeration
unsigned long state;
/// Pointer to a C array of objects to return
id *itemsPtr;
/// Arbitrary state information to detect mutations
unsigned long *mutationsPtr;
/// Additional arbitrary state information
unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif
/**
* The OFFastEnumeration protocol needs to be implemented by all classes
* supporting fast enumeration.
*/
@protocol OFFastEnumeration
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count;
@end
|
>
>
>
>
>
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
* This needs to be exactly like this because it's hardcoded in the compiler.
*
* We need this bad check to see if we already imported Cocoa, which defines
* this as well.
*/
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
/**
* \brief State information for fast enumerations.
*/
typedef struct __of_fast_enumeration_state {
/// Arbitrary state information for the enumeration
unsigned long state;
/// Pointer to a C array of objects to return
id *itemsPtr;
/// Arbitrary state information to detect mutations
unsigned long *mutationsPtr;
/// Additional arbitrary state information
unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif
/**
* \brief A protocol for fast enumeration.
*
* The OFFastEnumeration protocol needs to be implemented by all classes
* supporting fast enumeration.
*/
@protocol OFFastEnumeration
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count;
@end
|