From e89036395983a403afb4c597dbd1003e5542fdf4 Mon Sep 17 00:00:00 2001 From: mccallum Date: Sat, 8 Apr 1995 17:04:43 +0000 Subject: [PATCH] (ConstantKeyedCollecting): New protocol extracted from KeyedCollecting. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@319 72102866-910b-0410-8b05-ffd578937521 --- Headers/gnustep/base/KeyedCollecting.h | 68 ++++++++++++++------------ Source/objects/KeyedCollecting.h | 68 ++++++++++++++------------ 2 files changed, 74 insertions(+), 62 deletions(-) diff --git a/Headers/gnustep/base/KeyedCollecting.h b/Headers/gnustep/base/KeyedCollecting.h index 8f3335986..6f8a51cf6 100644 --- a/Headers/gnustep/base/KeyedCollecting.h +++ b/Headers/gnustep/base/KeyedCollecting.h @@ -1,5 +1,5 @@ /* Protocol for Objective-C objects holding (keyElement,contentElement) pairs. - Copyright (C) 1993,1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Written by: R. Andrew McCallum Date: May 1993 @@ -36,17 +36,7 @@ #include #include -@protocol KeyedCollecting - -// ADDING; -- putObject: newContentObject atKey: (elt)aKey; - -// REPLACING AND SWAPPING; -- replaceObjectAtKey: (elt)aKey with: newContentObject; -- swapAtKeys: (elt)key1 : (elt)key2; - -// REMOVING; -- removeObjectAtKey: (elt)aKey; +@protocol ConstantKeyedCollecting // GETTING ELEMENTS AND KEYS; - objectAtKey: (elt)aKey; @@ -61,13 +51,6 @@ - withKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc whileTrue: (BOOL *)flag; -// ENUMERATING WHILE CHANGING CONTENTS; -- safeWithKeyObjectsCall: (void(*)(id))aFunc; -- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc; -- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc - whileTrue: (BOOL *)flag; - - // NON-OBJECT ELEMENT METHOD NAMES; // INITIALIZING; @@ -75,18 +58,6 @@ keyType: (const char *)keyEncoding; - initKeyType: (const char *)keyEncoding; -// ADDING; -- putElement: (elt)newContentElement atKey: (elt)aKey; - -// REPLACING; -- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement; -- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement - ifAbsentCall: (elt(*)(arglist_t))excFunc; - -// REMOVING; -- (elt) removeElementAtKey: (elt)aKey; -- (elt) removeElementAtKey: (elt)aKey ifAbsentCall: (elt(*)(arglist_t))excFunc; - // GETTING ELEMENTS AND KEYS; - (elt) elementAtKey: (elt)aKey; - (elt) elementAtKey: (elt)aKey ifAbsentCall: (elt(*)(arglist_t))excFunc; @@ -105,6 +76,41 @@ - withKeyElementsAndContentElementsCall: (void(*)(elt,elt))aFunc whileTrue: (BOOL *)flag; +@end + +@protocol KeyedCollecting + +// ADDING; +- putObject: newContentObject atKey: (elt)aKey; + +// REPLACING AND SWAPPING; +- replaceObjectAtKey: (elt)aKey with: newContentObject; +- swapAtKeys: (elt)key1 : (elt)key2; + +// REMOVING; +- removeObjectAtKey: (elt)aKey; + +// ENUMERATING WHILE CHANGING CONTENTS; +- safeWithKeyObjectsCall: (void(*)(id))aFunc; +- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc; +- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc + whileTrue: (BOOL *)flag; + + +// NON-OBJECT ELEMENT METHOD NAMES; + +// ADDING; +- putElement: (elt)newContentElement atKey: (elt)aKey; + +// REPLACING; +- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement; +- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement + ifAbsentCall: (elt(*)(arglist_t))excFunc; + +// REMOVING; +- (elt) removeElementAtKey: (elt)aKey; +- (elt) removeElementAtKey: (elt)aKey ifAbsentCall: (elt(*)(arglist_t))excFunc; + // ENUMERATING WHILE CHANGING CONTENTS; - safeWithKeyElementsCall: (void(*)(elt))aFunc; - safeWithKeyElementsAndContentElementsCall: (void(*)(elt,elt))aFunc; diff --git a/Source/objects/KeyedCollecting.h b/Source/objects/KeyedCollecting.h index 8f3335986..6f8a51cf6 100644 --- a/Source/objects/KeyedCollecting.h +++ b/Source/objects/KeyedCollecting.h @@ -1,5 +1,5 @@ /* Protocol for Objective-C objects holding (keyElement,contentElement) pairs. - Copyright (C) 1993,1994 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Written by: R. Andrew McCallum Date: May 1993 @@ -36,17 +36,7 @@ #include #include -@protocol KeyedCollecting - -// ADDING; -- putObject: newContentObject atKey: (elt)aKey; - -// REPLACING AND SWAPPING; -- replaceObjectAtKey: (elt)aKey with: newContentObject; -- swapAtKeys: (elt)key1 : (elt)key2; - -// REMOVING; -- removeObjectAtKey: (elt)aKey; +@protocol ConstantKeyedCollecting // GETTING ELEMENTS AND KEYS; - objectAtKey: (elt)aKey; @@ -61,13 +51,6 @@ - withKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc whileTrue: (BOOL *)flag; -// ENUMERATING WHILE CHANGING CONTENTS; -- safeWithKeyObjectsCall: (void(*)(id))aFunc; -- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc; -- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc - whileTrue: (BOOL *)flag; - - // NON-OBJECT ELEMENT METHOD NAMES; // INITIALIZING; @@ -75,18 +58,6 @@ keyType: (const char *)keyEncoding; - initKeyType: (const char *)keyEncoding; -// ADDING; -- putElement: (elt)newContentElement atKey: (elt)aKey; - -// REPLACING; -- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement; -- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement - ifAbsentCall: (elt(*)(arglist_t))excFunc; - -// REMOVING; -- (elt) removeElementAtKey: (elt)aKey; -- (elt) removeElementAtKey: (elt)aKey ifAbsentCall: (elt(*)(arglist_t))excFunc; - // GETTING ELEMENTS AND KEYS; - (elt) elementAtKey: (elt)aKey; - (elt) elementAtKey: (elt)aKey ifAbsentCall: (elt(*)(arglist_t))excFunc; @@ -105,6 +76,41 @@ - withKeyElementsAndContentElementsCall: (void(*)(elt,elt))aFunc whileTrue: (BOOL *)flag; +@end + +@protocol KeyedCollecting + +// ADDING; +- putObject: newContentObject atKey: (elt)aKey; + +// REPLACING AND SWAPPING; +- replaceObjectAtKey: (elt)aKey with: newContentObject; +- swapAtKeys: (elt)key1 : (elt)key2; + +// REMOVING; +- removeObjectAtKey: (elt)aKey; + +// ENUMERATING WHILE CHANGING CONTENTS; +- safeWithKeyObjectsCall: (void(*)(id))aFunc; +- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc; +- safeWithKeyObjectsAndContentObjectsCall: (void(*)(id,id))aFunc + whileTrue: (BOOL *)flag; + + +// NON-OBJECT ELEMENT METHOD NAMES; + +// ADDING; +- putElement: (elt)newContentElement atKey: (elt)aKey; + +// REPLACING; +- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement; +- (elt) replaceElementAtKey: (elt)aKey with: (elt)newContentElement + ifAbsentCall: (elt(*)(arglist_t))excFunc; + +// REMOVING; +- (elt) removeElementAtKey: (elt)aKey; +- (elt) removeElementAtKey: (elt)aKey ifAbsentCall: (elt(*)(arglist_t))excFunc; + // ENUMERATING WHILE CHANGING CONTENTS; - safeWithKeyElementsCall: (void(*)(elt))aFunc; - safeWithKeyElementsAndContentElementsCall: (void(*)(elt,elt))aFunc;