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
/
COObject.h
75 lines (48 loc) · 1.53 KB
/
COObject.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
70
71
72
73
74
75
#import <Foundation/Foundation.h>
#import "COItem.h"
@class COObjectGraphContext;
@class COItemGraph;
@class COItemPath;
@class COSchema;
NSString *kCOSchemaName;
@interface COObject : NSObject
{
@package
COObjectGraphContext *parentContext_; // weak
COMutableItem *item_;
}
#pragma mark Serialization / Deserialization
@property (nonatomic, copy, readwrite) COItem *seriailzedItem;
#pragma mark Access to the receivers attributes/values
- (COObjectGraphContext *) editingContext;
- (ETUUID *) UUID;
- (NSArray *) attributeNames;
- (COType) typeForAttribute: (NSString *)anAttribute;
- (id) valueForAttribute: (NSString*)anAttribute;
- (NSString *) schemaName;
- (COSchema *) schema;
#pragma mark Access to the tree stucture
- (COObject *) embeddedObjectParent;
- (BOOL) containsObject: (COObject *)anObject;
- (NSSet *) allObjectUUIDs;
- (NSSet *) allDescendentObjectUUIDs;
- (NSSet *) directDescendentObjectUUIDs;
- (NSSet *) directDescendentObjects;
- (NSSet *) embeddedOrReferencedObjects;
/**
* Searches the receiver for the Object with the givent UUID.
* Returns nil if not present
*/
- (COObject *) descendentObjectForUUID: (ETUUID *)aUUID;
- (COItemPath *) itemPathOfDescendentObjectWithUUID: (ETUUID *)aUUID;
#pragma mark Mutation
/**
* Can only be used if we have a schema already set, or that attribute already had an
* explicit type set.
*/
- (void) setValue: (id)aValue
forAttribute: (NSString*)anAttribute;
- (void) setValue: (id)aValue
forAttribute: (NSString*)anAttribute
type: (COType)aType;
@end