mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Overhaul for new collection class scheme to improve distributed objects and NeXT-compatibility.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@940 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bbef3e0b35
commit
8b1ddb9758
52 changed files with 1839 additions and 2931 deletions
|
@ -32,29 +32,42 @@
|
|||
#include <Foundation/NSObject.h>
|
||||
#include <objects/Collecting.h>
|
||||
#include <objects/stdobjects.h>
|
||||
#include <objects/collhash.h>
|
||||
#include <objects/Coding.h>
|
||||
|
||||
@interface Collection : NSObject <Collecting>
|
||||
{
|
||||
}
|
||||
|
||||
- (void) withObjectsInvoke: anInvocation;
|
||||
- printElement: (elt)anElement;
|
||||
- printForDebugger;
|
||||
|
||||
@interface ConstantCollection : NSObject <ConstantCollecting>
|
||||
- printForDebugger; /* This method will disappear later. */
|
||||
@end
|
||||
|
||||
// #warning fix this macro
|
||||
#define FOR_COLL(ACOLL, ELT) \
|
||||
@interface Collection : ConstantCollection <Collecting>
|
||||
@end
|
||||
|
||||
@interface Enumerator : NSObject <Enumerating>
|
||||
{
|
||||
id collection;
|
||||
void *enum_state;
|
||||
}
|
||||
@end
|
||||
|
||||
#define FOR_COLLECTION(ACOLL, ELT) \
|
||||
{ \
|
||||
void *_es = [ACOLL initEnumState]; \
|
||||
while ([ACOLL getNextElement:&(ELT) withEnumState:&_es]) \
|
||||
void *_es = [ACOLL newEnumState]; \
|
||||
while ((ELT = [ACOLL nextObjectWithEnumState: &_es])) \
|
||||
{
|
||||
|
||||
#define FOR_COLL_END \
|
||||
#define END_FOR_COLLECTION(ACOLL) \
|
||||
} \
|
||||
[ACOLL freeEnumState:_es]; \
|
||||
[ACOLL freeEnumState: &_es]; \
|
||||
}
|
||||
|
||||
#define FOR_COLLECTION_WHILE_TRUE(ACOLL, ELT, FLAG) \
|
||||
{ \
|
||||
void *_es = [ACOLL newEnumState]; \
|
||||
while (FLAG && (ELT = [ACOLL nextObjectWithEnumState: &_es])) \
|
||||
{
|
||||
|
||||
#define END_FOR_COLLECTION_WHILE_TRUE(ACOLL) \
|
||||
} \
|
||||
[ACOLL freeEnumState: &_es]; \
|
||||
}
|
||||
|
||||
/* The only subclassResponsibilities in Collection are:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue