4 Copyright (C) 1996 Free Software Foundation, Inc.
6 Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
9 This file is part of the GNUstep Database Library.
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Library 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.
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.
21 You should have received a copy of the GNU Library General Public
22 License along with this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #ifndef __EOObjectUniquer_h__
28 #define __EOObjectUniquer_h__
30 #import <Foundation/NSObject.h>
31 #import <Foundation/NSMapTable.h>
37 typedef struct _EOUniquerRecord {
45 @interface EOObjectUniquer : NSObject
48 NSMapTable *primaryKeyToRec;
49 NSMapTable *objectsToRec;
50 struct _EOUniquerRecord *keyRecord;
53 // Initializing a uniquing dictionary
56 // Transfer self to parent
57 - (void)transferTo:(EOObjectUniquer*)dest
58 objects:(BOOL)isObj andSnapshots:(BOOL)isSnap;
61 - (void)forgetObject:(id)anObj;
62 - (void)forgetAllObjects;
63 - (void)forgetAllSnapshots;
65 - (id)objectForPrimaryKey:(NSDictionary *)aKey
66 entity:(EOEntity *)anEntity;
68 - (EOUniquerRecord *)recordForObject:(id)anObj;
70 - (void)recordObject:(id)anObj
71 primaryKey:(NSDictionary *)aKey
72 entity:(EOEntity *)anEntity
73 snapshot:(NSDictionary *)aSnapshot;
75 @end /* EOObjectUniquer */
77 #endif /* __EOObjectUniquer_h__ */