-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathETModelRepository.h
69 lines (49 loc) · 2.12 KB
/
ETModelRepository.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
/** <title>ETModelRepository</title>
<abstract>A generic object repository.</abstract>
Copyright (C) 2010 Quentin Mathe
Author: Quentin Mathe <[email protected]>
Date: September 2010
License: Modified BSD (see COPYING)
*/
#import <EtoileFoundation/EtoileFoundation.h>
/** Warning: Unstable and experimental API.
A repository to track objects to which correspond model descriptions hold
in a meta repository.<br />
A model description repository can be used without a model repository, but the
reverse is not true.
Each object must have a class or prototype description present in the meta
repository.
The repository content is not ordered.
Note: Metadescribed prototypes are not well supported yet. */
@interface ETModelRepository : NSObject <ETCollection, ETCollectionMutation>
{
@private
NSMutableSet *_content;
ETModelDescriptionRepository *_metaRepository;
}
/** Returns the initial repository that exists in each process.
When this repository is created, a +[ETModelDescriptionRepository mainRepository]
is used as the meta repository. */
+ (id) mainRepository;
/** <init />
Initializes and returns a new instance repository bound to the given model
description repository. */
- (id) initWithMetaRepository: (ETModelDescriptionRepository *)aRepository;
/** Adds the given object to the repository. */
- (void) addObject: (id)anObject;
/** Removes the given object from the repository. */
- (void) removeObject: (id)anObject;
/** Returns whether the given is present in the repository. */
- (void) containsObject: (id)anObject;
/** Returns the objects present in the repository as an array.
The returned array contains no duplicate objects. */
- (NSArray *) objects;
/** Returns the model description repository that describes the objects in the
repository with a metamodel. */
- (ETModelDescriptionRepository *) metaRepository;
/* Runtime Consistency Check */
/** Checks the receiver content is correctly described at the meta repository
level and adds a short warning to the given array for each failure.
Will invoke -checkConstraints on the meta repository. */
- (void) checkConstraints: (NSMutableArray *)warnings;
@end