Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOOXPVerifierStage Class Reference

#include <OOOXPVerifierStage.h>

+ Inheritance diagram for OOOXPVerifierStage:
+ Collaboration diagram for OOOXPVerifierStage:

Instance Methods

(OOOXPVerifier *) - verifier
 
(BOOL) - completed
 
(NSString *) - name
 
(NSSet *) - dependencies
 
(NSSet *) - dependents
 
(BOOL) - shouldRun
 
(void) - run
 
(id) - init [implementation]
 
(void) - dealloc [implementation]
 
(id) - description [implementation]
 
(void) - setVerifier: [implementation]
 
(BOOL) - isDependentOf: [implementation]
 
(void) - registerDependency: [implementation]
 
(void) - dependencyRegistrationComplete [implementation]
 
(BOOL) - canRun [implementation]
 
(void) - performRun [implementation]
 
(void) - noteSkipped [implementation]
 
(NSSet *) - resolvedDependencies [implementation]
 
(NSSet *) - resolvedDependents [implementation]
 
(void) - registerDepedent: [implementation]
 
(void) - dependencyCompleted: [implementation]
 

Private Attributes

OOOXPVerifier_verifier
 
NSMutableSet * _dependencies
 
NSMutableSet * _incompleteDependencies
 
NSMutableSet * _dependents
 
BOOL _canRun
 
BOOL _hasRun
 

Detailed Description

Definition at line 34 of file OOOXPVerifierStage.h.

Method Documentation

◆ canRun

- (BOOL) canRun
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

159{
160 return _canRun;
161}

◆ completed

- (BOOL) completed

Definition at line 1 of file OOOXPVerifierStage.m.

83{
84 return _hasRun;
85}

◆ dealloc

- (void) dealloc
implementation

Reimplemented in OOAIStateMachineVerifierStage, OOFileScannerVerifierStage, OOModelVerifierStage, and OOTextureVerifierStage.

Definition at line 1 of file OOOXPVerifierStage.m.

61{
62 [_dependencies release];
63 [_incompleteDependencies release];
64 [_dependents release];
65
66 [super dealloc];
67}

◆ dependencies

- (NSSet *) dependencies

Reimplemented in OOFileHandlingVerifierStage, and OOListUnusedFilesStage.

Definition at line 1 of file OOOXPVerifierStage.m.

96{
97 return nil;
98}
return nil

◆ dependencyCompleted:

- (void) dependencyCompleted: (OOOXPVerifierStage *) dependency
implementation

Provided by category OOOXPVerifierStage(OOPrivate).

Definition at line 1 of file OOOXPVerifierStage.m.

225 :(OOOXPVerifierStage *)dependency
226{
227 [_incompleteDependencies removeObject:dependency];
228 if ([_incompleteDependencies count] == 0) _canRun = YES;
229}
unsigned count

◆ dependencyRegistrationComplete

- (void) dependencyRegistrationComplete
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

196{
197 _canRun = [_incompleteDependencies count] == 0;
198}

◆ dependents

- (NSSet *) dependents

Reimplemented in OOCheckShipDataPListVerifierStage, OOFileHandlingVerifierStage, and OOTextureHandlingStage.

Definition at line 1 of file OOOXPVerifierStage.m.

102{
103 return nil;
104}

◆ description

- (id) description
implementation

Definition at line 1 of file OOOXPVerifierStage.m.

71{
72 return [NSString stringWithFormat:@"<%@ %p>{\"%@\"}", [self class], self, [self name]];
73}

◆ init

- (id) init
implementation

Reimplemented in OOModelVerifierStage, and OOTextureVerifierStage.

Definition at line 1 of file OOOXPVerifierStage.m.

45{
46 self = [super init];
47
48 if (self != nil)
49 {
50 _dependencies = [[NSMutableSet alloc] init];
51 _incompleteDependencies = [[NSMutableSet alloc] init];
52 _dependents = [[NSMutableSet alloc] init];
53 _canRun = NO;
54 }
55
56 return self;
57}
NSMutableSet * _incompleteDependencies
NSMutableSet * _dependencies
NSMutableSet * _dependents

◆ isDependentOf:

- (BOOL) isDependentOf: (OOOXPVerifierStage *) stage
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

129 :(OOOXPVerifierStage *)stage
130{
131 NSEnumerator *directDepEnum = nil;
132 OOOXPVerifierStage *directDep = nil;
133
134 if (stage == nil) return NO;
135
136 // Direct dependency check.
137 if ([_dependencies containsObject:stage]) return YES;
138
139 // Recursive dependency check.
140 for (directDepEnum = [_dependencies objectEnumerator]; (directDep = [directDepEnum nextObject]); )
141 {
142 if ([directDep isDependentOf:stage]) return YES;
143 }
144
145 return NO;
146}

◆ name

◆ noteSkipped

- (void) noteSkipped
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

186{
187 assert(_canRun && !_hasRun);
188
189 _hasRun = YES;
190 _canRun = NO;
191 [_dependents makeObjectsPerformSelector:@selector(dependencyCompleted:) withObject:self];
192}

◆ performRun

- (void) performRun
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

165{
166 assert(_canRun && !_hasRun);
167
169 @try
170 {
171 [self run];
172 }
173 @catch (NSException *exception)
174 {
175 OOLog(@"verifyOXP.exception", @"***** Exception while running verification stage \"%@\": %@", [self name], exception);
176 }
178
179 _hasRun = YES;
180 _canRun = NO;
181 [_dependents makeObjectsPerformSelector:@selector(dependencyCompleted:) withObject:self];
182}
void OOLogPushIndent(void)
Definition OOLogging.m:316
void OOLogPopIndent(void)
Definition OOLogging.m:340
#define OOLog(class, format,...)
Definition OOLogging.h:88

◆ registerDepedent:

- (void) registerDepedent: (OOOXPVerifierStage *) dependent
implementation

Provided by category OOOXPVerifierStage(OOPrivate).

Definition at line 1 of file OOOXPVerifierStage.m.

217 :(OOOXPVerifierStage *)dependent
218{
219 assert(![self isDependentOf:dependent]);
220
221 [_dependents addObject:dependent];
222}

◆ registerDependency:

- (void) registerDependency: (OOOXPVerifierStage *) dependency
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

149 :(OOOXPVerifierStage *)dependency
150{
151 [_dependencies addObject:dependency];
152 [_incompleteDependencies addObject:dependency];
153
154 [dependency registerDepedent:self];
155}
void registerDepedent:(OOOXPVerifierStage *dependent)

◆ resolvedDependencies

- (NSSet *) resolvedDependencies
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

202{
203 return _dependencies;
204}

◆ resolvedDependents

- (NSSet *) resolvedDependents
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

208{
209 return _dependents;
210}

◆ run

◆ setVerifier:

- (void) setVerifier: (OOOXPVerifier *) verifier
implementation

Provided by category OOOXPVerifierStage(OOInternal).

Definition at line 1 of file OOOXPVerifierStage.m.

123 :(OOOXPVerifier *)verifier
124{
125 _verifier = verifier; // Not retained.
126}

◆ shouldRun

◆ verifier

- (OOOXPVerifier *) verifier

Definition at line 1 of file OOOXPVerifierStage.m.

77{
78 return [[_verifier retain] autorelease];
79}

Member Data Documentation

◆ _canRun

- (BOOL) _canRun
private

Definition at line 41 of file OOOXPVerifierStage.h.

◆ _dependencies

- (NSMutableSet*) _dependencies
private

Definition at line 38 of file OOOXPVerifierStage.h.

◆ _dependents

- (NSMutableSet*) _dependents
private

Definition at line 40 of file OOOXPVerifierStage.h.

◆ _hasRun

- (BOOL) _hasRun
private

Definition at line 41 of file OOOXPVerifierStage.h.

◆ _incompleteDependencies

- (NSMutableSet*) _incompleteDependencies
private

Definition at line 39 of file OOOXPVerifierStage.h.

◆ _verifier

- (OOOXPVerifier*) _verifier
private

Definition at line 37 of file OOOXPVerifierStage.h.


The documentation for this class was generated from the following files: