This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CORelationshipCache.h
69 lines (53 loc) · 1.83 KB
/
CORelationshipCache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#import <Foundation/Foundation.h>
#import "COType.h"
@class ETUUID;
@class COItem;
@interface CORelationshipRecord : NSObject
{
@private
ETUUID *uuid_;
NSString *property_;
}
+ (CORelationshipRecord *) recordWithUUID: (ETUUID *)aUUID property: (NSString *)aProp;
// FIXME: Make not mutable to the public
@property (readwrite, nonatomic, retain) ETUUID *uuid;
@property (readwrite, nonatomic, retain) NSString *property;
@end
/**
* Simple wrapper around an NSMutableDictionary mapping COUUID's to mutable sets of COUUID's.
*/
@interface CORelationshipCache : NSObject
{
NSMutableDictionary *embeddedObjectParentUUIDForUUID_;
NSMutableDictionary *referrerUUIDsForUUID_;
CORelationshipRecord *tempRecord_;
}
/**
* @returns a set of CORelationshipRecord
*/
- (NSSet *) referrersForUUID: (ETUUID *)anObject;
- (CORelationshipRecord *) parentForUUID: (ETUUID *)anObject;
/**
* @returns a set of COUUID
*/
- (NSSet *) referrersForUUID: (ETUUID *)anObject
propertyInParent: (NSString*)propInParent;
#pragma mark modification
- (void) updateRelationshipCacheWithOldValue: (id)oldVal
oldType: (COType)oldType
newValue: (id)newVal
newType: (COType)newType
forProperty: (NSString *)aProperty
ofObject: (ETUUID *)anObject;
- (void) clearOldValue: (id)oldVal
oldType: (COType)oldType
forProperty: (NSString *)aProperty
ofObject: (ETUUID *)anObject;
- (void) setNewValue: (id)newVal
newType: (COType)newType
forProperty: (NSString *)aProperty
ofObject: (ETUUID *)anObject;
- (void) addItem: (COItem *)anItem;
- (void) removeItem: (COItem *)anItem;
- (void) removeAllEntries;
@end