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
/
Copy pathCOPersistentRoot.h
95 lines (72 loc) · 2.17 KB
/
COPersistentRoot.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#import <Foundation/Foundation.h>
#import <EtoileFoundation/ETUUID.h>
#import "CORevisionID.h"
#import "COSQLiteStore.h"
@class COBranch;
@class COStore;
@class COObjectGraphContext;
/**
* goals:
* - intended to be the model object backing a document window UI.
*
* - support having an object's branches open in their own
* windows an editing them simiultaneously
*
*/
@interface COPersistentRoot : NSObject
{
COStore *rootStore_; // weak
COPersistentRootInfo *savedState_;
/**
* if the user has called -contextForEditingCurrentBranch,
* this will hold that context (which is a "singleton"
* within the context of this COPersistentRootEditQueue
* instance).
*/
COBranch *currentBranch_;
NSMutableDictionary *branchForUUID_;
}
- (ETUUID *) UUID;
// metadata & convenience
- (NSDictionary *) metadata;
// commits immediately
- (void) setMetadata: (NSDictionary *)theMetadata;
- (NSString *) name;
// commits immediately
- (void) setName: (NSString *)aName;
// branches
- (NSSet *) branches;
/**
* @returns array of CORevisionID
*/
- (NSArray *) revisionIDs;
// editing context
/**
* I made a note that ideal behaviour would be:
* - user is working on some feature branch
* - user sees an old version on master they want to try working with instead,
* so they double-click it
* - this creates a new branch at that point and commits it.
*
* ---
* Commits the new branch immediately
*/
- (COBranch *) createBranchAtRevision: (CORevisionID *)aRevision
setCurrent: (BOOL)setCurrent;
/**
* returns a special proxy context which will
* change to reflect any changes to the current branch
*
* It's going to be a bit of work to handle the case where
* there is this context open on a particular branch,
* as well as the explicit one created by -contextForEditingBranchWithUUID
* because they should stay in sync?
*
* On second thought it may not matter.
*/
- (COBranch *) currentBranch;
// commits immediately
- (void) setCurrentBranch: (COBranch *)aBranch;
- (void) removeBranch: (COBranch *)aBranch;
- (COObjectGraphContext *) readonlyContextForViewingRevision: (CORevisionID *)aRevision;
@end