This class has the role of executing the operation object following the scheduler rules.
Each operation that needs to be executed is placed in a queue so it will be performed
only when possible
More...
Public Member Functions | |
| OperationsExecutionScheduler (IScheduler scheduler) | |
| Constructor More... | |
| void | AddOperationToExecutionQueue (Operation operation) |
| Adds an operation to the execution queue. This operaton will execute as soon as possible. More... | |
| void | RemoveAllOperationsInQueue () |
| Removes all the operations in the execution queue that are not executing More... | |
Protected Member Functions | |
| void | OnWillExecuteOperation (Operation operation) |
| This method fires the "OnWillExecuteOperation" using the EventManager More... | |
| void | OnDidExecutedOperation (Operation operation) |
| This method fires the "OnDidExecutedOperation" using the EventManager More... | |
| virtual void | PrepareOperationForExecution (Operation operation) |
| This method must be called from the OperationExecutionScheduler subclasses before an operation starts execution and it will fire the "OnWillExecuteOperation" Event using the EventManager More... | |
| virtual void | ExecuteOperation (Operation operation) |
| This method must be overridden and called from the OperationExecutionScheduler subclasses when executing an operation More... | |
| void | OperationExecutionCompleted (Operation operation) |
| This method must be called from the OperationExecutionScheduler subclasses when an operation has completed execution. It will remove the Operation from the "OnWillExecuteOperation" Event using the EventManager More... | |
| virtual Operation | PickOperationToExecute () |
| Returns the next operation to execute, removes it from the OperationsToExecuteQueue, then pushes it to the OperationsToExecuteQueue More... | |
Protected Attributes | |
| int | maxSimultaneousOperations |
Properties | |
| int | MaxSimultaneousOperations [get] |
| Maximum number of simultaneous operations ( Default = 1 ) More... | |
| List< Operation > | OperationsToExecute [get, set] |
| List< Operation > | OperationsInExecution [get, set] |
| int | NumberOfOperationsInQueue [get] |
| The number of operations in the queue waiting to be executed More... | |
| int | NumberOfOperationsInExecution [get] |
| Number of operations that are executing More... | |
| Boolean | IsExecutingOperations [get] |
| True if currently executing operations More... | |
| Boolean | CanPerformOperations [get] |
| True if currently executing fewer operations than the MaxSimultaneousOperations More... | |
| EventsScheduler | EventManager [get, set] |
| Fire the events on the right Dispatcher More... | |
| IScheduler | Scheduler [get, set] |
| Execute the operation's completion handler on the right Dispatcher More... | |
Events | |
| EventHandler< VisionEventOperationArgs > | WillExecuteOperation |
| Fired before start to execute an operation More... | |
| EventHandler< VisionEventOperationArgs > | DidExecuteOperation |
| Fired when an operation execution is completed More... | |
This class has the role of executing the operation object following the scheduler rules.
Each operation that needs to be executed is placed in a queue so it will be performed
only when possible
| VisionSDK.Operations.Execution.OperationsExecutionScheduler.OperationsExecutionScheduler | ( | IScheduler | scheduler | ) |
Constructor
| scheduler | The IScheduler used to fire events in the right Dispatcher |
| void VisionSDK.Operations.Execution.OperationsExecutionScheduler.AddOperationToExecutionQueue | ( | Operation | operation | ) |
Adds an operation to the execution queue. This operaton will execute as soon as possible.
| operation | The operation to execute |
|
protectedvirtual |
This method must be overridden and called from the OperationExecutionScheduler subclasses when executing an operation
| operation | The operation that has started the execution |
Reimplemented in VisionSDK.Operations.Execution.OperationsExecutionSchedulerAsyncBackgroundWorker, and VisionSDK.Operations.Execution.OperationsExecutionSchedulerSync.
|
protected |
This method fires the "OnDidExecutedOperation" using the EventManager
| operation | The operation that has terminated the execution |
|
protected |
This method fires the "OnWillExecuteOperation" using the EventManager
| operation | The operation that will start the execution |
|
protected |
This method must be called from the OperationExecutionScheduler subclasses when an operation has completed execution. It will remove the Operation from the "OnWillExecuteOperation" Event using the EventManager
| operation | The operation that has terminated the execution |
|
protectedvirtual |
Returns the next operation to execute, removes it from the OperationsToExecuteQueue, then pushes it to the OperationsToExecuteQueue
|
protectedvirtual |
This method must be called from the OperationExecutionScheduler subclasses before an operation starts execution and it will fire the "OnWillExecuteOperation" Event using the EventManager
| operation | The operation that will start the execution |
| void VisionSDK.Operations.Execution.OperationsExecutionScheduler.RemoveAllOperationsInQueue | ( | ) |
Removes all the operations in the execution queue that are not executing
|
protected |
|
getprotected |
True if currently executing fewer operations than the MaxSimultaneousOperations
|
getset |
Fire the events on the right Dispatcher
|
get |
True if currently executing operations
|
get |
Maximum number of simultaneous operations ( Default = 1 )
|
get |
Number of operations that are executing
|
get |
The number of operations in the queue waiting to be executed
|
getsetprotected |
|
getsetprotected |
|
getset |
Execute the operation's completion handler on the right Dispatcher
| EventHandler<VisionEventOperationArgs> VisionSDK.Operations.Execution.OperationsExecutionScheduler.DidExecuteOperation |
Fired when an operation execution is completed
| EventHandler<VisionEventOperationArgs> VisionSDK.Operations.Execution.OperationsExecutionScheduler.WillExecuteOperation |
Fired before start to execute an operation