]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOObjectUniquer.h
fixed build with gstep-make 1.9.2
[sope] / sope-gdl1 / GDLAccess / EOObjectUniquer.h
1 /* 
2    EOObjectUniquer.h
3
4    Copyright (C) 1996 Free Software Foundation, Inc.
5
6    Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
7    Date: 1996
8
9    This file is part of the GNUstep Database Library.
10
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.
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 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.
25 */
26
27 #ifndef __EOObjectUniquer_h__
28 #define __EOObjectUniquer_h__
29
30 #import <Foundation/NSObject.h>
31 #import <Foundation/NSMapTable.h>
32
33 @class EOEntity;
34 @class NSDictionary;
35 @class NSArray;
36
37 typedef struct _EOUniquerRecord {
38     int refCount;
39     id  pkey;
40     id  entity;
41     id  object;
42     id  snapshot;
43 } EOUniquerRecord;
44
45 @interface EOObjectUniquer : NSObject
46 {
47 @protected
48     NSMapTable              *primaryKeyToRec;
49     NSMapTable              *objectsToRec;
50     struct _EOUniquerRecord *keyRecord;
51 }
52
53 // Initializing a uniquing dictionary
54 - init;
55
56 // Transfer self to parent
57 - (void)transferTo:(EOObjectUniquer*)dest
58   objects:(BOOL)isObj andSnapshots:(BOOL)isSnap;
59
60 // Handling objects
61 - (void)forgetObject:(id)anObj;
62 - (void)forgetAllObjects;
63 - (void)forgetAllSnapshots;
64
65 - (id)objectForPrimaryKey:(NSDictionary *)aKey
66   entity:(EOEntity *)anEntity;
67
68 - (EOUniquerRecord *)recordForObject:(id)anObj;
69
70 - (void)recordObject:(id)anObj
71   primaryKey:(NSDictionary *)aKey
72   entity:(EOEntity *)anEntity
73   snapshot:(NSDictionary *)aSnapshot;
74
75 @end /* EOObjectUniquer */
76
77 #endif /* __EOObjectUniquer_h__ */
78
79 /*
80   Local Variables:
81   c-basic-offset: 4
82   tab-width: 8
83   End:
84 */