diff --git a/ChangeLog b/ChangeLog index 4509f10..999ebd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-07-30 Richard Frith-Macdonald + + * EcProcess.h: + * EcProcess.m: + Added +ecSetup method to create/initialise the singleton instance. + 2014-07-01 Richard Frith-Macdonald * Command.m: diff --git a/EcProcess.h b/EcProcess.h index 3dc833c..1453266 100644 --- a/EcProcess.h +++ b/EcProcess.h @@ -417,6 +417,14 @@ extern NSString* cmdVersion(NSString *ver); */ + (NSMutableDictionary*) ecInitialDefaults; +/** Convenience method to create the singleton EcProcess instance + * using the initial configuration provided by the +ecInitialDefaults + * method.
+ * Raises NSGenericException if the singleton instance has already + * been created. + */ ++ (void) ecSetup; + /** Convenience method to produce a generic configuration alarm and send * it via the -alarm: method.
* The managed object may be nil (in which case it's the default managed object diff --git a/EcProcess.m b/EcProcess.m index 3cf5349..0e60715 100644 --- a/EcProcess.m +++ b/EcProcess.m @@ -1025,6 +1025,16 @@ findMode(NSDictionary* d, NSString* s) count: 2]; } ++ (void) ecSetup +{ + if (nil != EcProc) + { + [NSException raise: NSGenericException + format: @"+ecSetup called when EcProcess is already set up"]; + } + [[self alloc] init]; +} + - (void) _commandRemove { id connection = [cmdServer connectionForProxy];