1 /* 2 NSEnumerator.h 3 4 Copyright (C) 1998 Free Software Foundation, Inc. 5 6 Author: Scott Christley <scottc@net-community.com> 7 Date: January 1998 8 9 This file is part of the GNUstep Base Library. 10 11 This library is free software; you can redistribute it and/or 12 modify it under the terms of the GNU Lesser General Public 13 License as published by the Free Software Foundation; either 14 version 2 of the License, or (at your option) any later version. 15 16 This library is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 Library General Public License for more details. 20 21 You should have received a copy of the GNU Lesser General Public 22 License along with this library; if not, write to the Free 23 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 Boston, MA 02111 USA. 25 */ 26 27 #ifndef __NSEnumerator_h_GNUSTEP_BASE_INCLUDE 28 #define __NSEnumerator_h_GNUSTEP_BASE_INCLUDE 29 #import "../GNUstepBase/GSVersionMacros.h" 30 31 #import "NSObject.h" 32 33 34 #if defined(__cplusplus) 35 extern "C" { 36 #endif 37 38 @class GS_GENERIC_CLASS(NSArray, ElementT); 39 40 typedef struct 41 { 42 unsigned long state; 43 __unsafe_unretained id *itemsPtr; 44 unsigned long *mutationsPtr; 45 unsigned long extra[5]; 46 } NSFastEnumerationState; 47 48 @protocol NSFastEnumeration 49 - (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState *)state 50 objects: (__unsafe_unretained id[])stackbuf 51 count: (NSUInteger)len; 52 @end 53 54 @interface GS_GENERIC_CLASS(NSEnumerator, IterT) : NSObject <NSFastEnumeration> 55 - (GS_GENERIC_CLASS(NSArray, IterT) *) allObjects; 56 - (GS_GENERIC_TYPE(IterT)) nextObject; 57 @end 58 59 #if defined(__cplusplus) 60 } 61 #endif 62 63 #endif /* __NSEnumerator_h_GNUSTEP_BASE_INCLUDE */ 64