usbdmx.com Home of the opto isolated, bus powered, DMX512 interface with both in and out universes. Cheap and simple to build. USBDMX logo

LOCommandProcessor Class Reference

The command processor takes a sequence of tokens and processes them. More...

#import <LOCommandProcessor.h>


Public Member Functions

(id) - init
(id) - delegate
 Get the current delegate.
(void) - setDelegate:
 Set a new delegate object.
(BOOL) - executeTokens:
 Execute an array of tokens.
(void) - resetTokens
 Reset the command.
(BOOL) - addToken:
 Add a token to the command processor chain.
(BOOL) - execute
 Execute the added tokens.
(BOOL) - releaseChannels
 Release captured channels.
(BOOL) - cancelSolo
 Turn Solo off.
(BOOL) - commandPossible
 Test to see if all the current tokens could be executed now.
(BOOL) - commandComplete
 Test to see if all the current tokens must be executed now.

Static Public Member Functions

(LODirectProvider *) + defaultCaptureProvider
 Get the applications default capture provider.
(LODirectProvider *) + defaultSoloProvider
 Get the applications default solo provider.
(NSMutableIndexSet *) + defaultCapturedChannels
 Get the applications default list of captured channels.
(NSMutableIndexSet *) + defaultLastChannels
 Get the applications default list of the last range of channels entered by the user.

Protected Attributes

id delegate
 A delegate to allow cusstomisation of commands.
BOOL delegateMustExecute
 True if the delegate has to execute the command.
NSMutableIndexSet * commandChannels
 All possible channels the command affects.
unsigned lastNumber
 Used to store the last number entered in a range.
BOOL lastSign
 Used to store the last + or - token in a range.
BOOL channelsIdentified
 Tells us if the channel range has been identified.
LOCommandTokenlastToken
 The last token we added.
LOCommandTokenvalueToken
 The value token used at the end of the command.
BOOL commandPossible
 True if its possible to execute a command now.
BOOL commandEnd
 Ture if this must be the end of the command.
BOOL rangeStart
 True if a range could have started.
BOOL capturePlus
 The range should be added to tier1.
BOOL tier2Plus
 The range should automatically include tier2.
BOOL noLast
 If set will not update the last channels.


Detailed Description

The command processor takes a sequence of tokens and processes them.

Member Function Documentation

- (BOOL) addToken: (LOCommandToken *)  theToken  

Add a token to the command processor chain.

If the token would cause an error, the token is not added and NO is returned.

- (BOOL) cancelSolo  

Turn Solo off.

Any channels captured by the initial solo command will stay captured, just all the other channels will return to thier originals values.

- (BOOL) commandComplete  

Test to see if all the current tokens must be executed now.

See also:
commandPossible

- (BOOL) commandPossible  

Test to see if all the current tokens could be executed now.

See also:
- commandComplete

+ (NSMutableIndexSet *) defaultCapturedChannels  

Get the applications default list of captured channels.

+ (LODirectProvider *) defaultCaptureProvider  

Get the applications default capture provider.

+ (NSMutableIndexSet *) defaultLastChannels  

Get the applications default list of the last range of channels entered by the user.

+ (LODirectProvider *) defaultSoloProvider  

Get the applications default solo provider.

- (id) delegate  

Get the current delegate.

Returns:
The delegate object
See also:
- setDelegate:

NSObject(LOCommandProcessorDelegate) in LOCommandProcessor.h

- (BOOL) executeTokens: (NSArray *)  theTokens  

Execute an array of tokens.

First any existing tokens are removed.

Parameters:
theTokens an array of LOCommandTokens
Returns:
YES if the command was sucessful

- (BOOL) releaseChannels  

Release captured channels.

The first time this method is called it will release only the last group of channels to be captured. Once those channels are released the second call to this method will release all captured channels, unless a new set of channles have been captured in the mean time.

- (void) setDelegate: (id)  aDelegate  

Set a new delegate object.

Parameters:
aDelegate The object to receive all delegate messages
See also:
delegate:

NSObject(LOCommandProcessorDelegate) in LOCommandProcessor.h


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