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

NSObject(LOCommandProcessorDelegate) Class Reference

Delegate interface to customise the behaviour of the LOCommandProcessor. More...

#import <LOCommandProcessor.h>


Public Member Functions

(LOCommandProcessorDelegateReturn) - shouldAcceptToken:processor:channelsIdentified:mustExecute:
 See if the delegate wants to allow the token to be added.
(LOCommandProcessorDelegateReturn) - execute:mustExecute:withOptions:
 Called when the command processor needs to execute the command.
(BOOL) - isCommandPosisble:defaultPosisble:
 Called to see if the current command is posisble.
(BOOL) - isCommandComplete:defaultComplete:
 Called to see if the current command is complete.
(void) - didResetTokens:
 Called whenever the command processor resets the currently processed tokens.


Detailed Description

Delegate interface to customise the behaviour of the LOCommandProcessor.

Member Function Documentation

- (void) didResetTokens: (LOCommandProcessor *)  processor  

Called whenever the command processor resets the currently processed tokens.

- (LOCommandProcessorDelegateReturn) execute: (LOCommandProcessor *)  processor
mustExecute: (BOOL)  flag
withOptions: (NSDictionary *)  options 

Called when the command processor needs to execute the command.

If the delegate must execte the command (because it accpeted a token that would not be a valid default command line) then flag will be true.

options contains an entry under the key LOCommandProcessorChannels with the user selected channels (unless the delagte overruled the command structure before all the channels were set), also contained in options is LOCommandProcessorLastToken and LOCommandProcessorValueToken

Returns:
The delegate can return LOCommandProcessorDelegateReturnNO to indicate that it was not posisble to exectue the command or LOCommandProcessorDelegateReturnYES to show it has executed the command. Or if flag if flase it can return LOCommandProcessorDelegateReturnDEFAULT to allow the command processor to execute the command.
See also:
shouldAcceptToken:processor:channelsIdentified:mustExecute

- (BOOL) isCommandComplete: (LOCommandProcessor *)  processor
defaultComplete: (BOOL)  complete 

Called to see if the current command is complete.

defaultComplete is true if the command would be considered complete if processed by the default command set.

- (BOOL) isCommandPosisble: (LOCommandProcessor *)  processor
defaultPosisble: (BOOL)  possible 

Called to see if the current command is posisble.

defaultPosisble is true if the command would be considered possible if processed by the default command set.

- (LOCommandProcessorDelegateReturn) shouldAcceptToken: (LOCommandToken *)  theToken
processor: (LOCommandProcessor *)  processor
channelsIdentified: (BOOL)  identifiedFlag
mustExecute: (BOOL)  executeFlag 

See if the delegate wants to allow the token to be added.

The delegate can either return LOCommandProcessorDelegateReturnNO or LOCommandProcessorDelegateReturnYES in which case the delegates decision is final. Or LOCommandProcessorDelegateReturnDEFAULT in which case its left upto the default command set implementation.

Parameters:
theToken The token that the user is trying to add to the command
processor The actual processor being used to call the delegate
identifiedFlag True if the processor has identied the channels from the command
executeFlag True if the delegate has already overridded the processor to the point where it must execute the command. If this happens before the channels have been identified, the delegate must be responsible for identifying them
NOTE: If you return LOCommandProcessorDelegateReturnYES and the default command set would have returned NO, then the delegate must execte the command when the time comes.

See also:
execute:mustExecute:withOptions


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