]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOAdaptorGlobalID.m
minor changes to Xcode project layout
[sope] / sope-gdl1 / GDLAccess / EOAdaptorGlobalID.m
1 /* 
2    EOArrayProxy.h
3
4    Copyright (C) 1999 MDlink online service center GmbH, Helge Hess
5
6    Author: Helge Hess (hh@mdlink.de)
7    Date:   1999
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 // $Id: EOAdaptorGlobalID.m 1 2004-08-20 10:38:46Z znek $
27
28 #include <GDLAccess/EOAdaptorGlobalID.h>
29 #include "common.h"
30
31 @implementation EOAdaptorGlobalID
32
33 - (id)initWithGlobalID:(EOGlobalID *)_gid
34   connectionDictionary:(NSDictionary *)_conDict
35 {
36   if ((self = [super init])) {
37     ASSIGN(self->gid, _gid);
38     ASSIGN(self->conDict, _conDict);
39   }
40   return self;
41 }
42
43 - (void)dealloc {
44   RELEASE(self->gid);
45   RELEASE(self->conDict);
46   [super dealloc];
47 }
48
49 - (EOGlobalID *)globalID {
50   return self->gid;
51 }
52
53 - (NSDictionary *)connectionDictionary {
54   return self->conDict;
55 }
56
57 /* NSCopying */
58
59 - (id)copyWithZone:(NSZone *)_zone {
60   return RETAIN(self);
61 }
62
63 /* equality */
64
65 - (BOOL)isEqual:(id)_obj {
66   if ([_obj isKindOfClass:[EOAdaptorGlobalID class]])
67     return [self isEqualToEOAdaptorGlobalID:_obj];
68   return NO;
69 }
70
71 - (BOOL)isEqualToEOAdaptorGlobalID:(EOAdaptorGlobalID *)_gid {
72   if ([[_gid globalID] isEqual:self->gid] &&
73       [[_gid connectionDictionary] isEqual:self->conDict])
74     return YES;
75   
76   return NO;
77 }
78
79 /* description */
80
81 - (NSString *)description {
82   return [NSString stringWithFormat:@"%@: globalID: %@ connectionDictionary: %@",
83                    [super description], self->gid, self->conDict];
84 }
85
86 @end /* SkyDBGlobalKey */