Impact Vision SDK  11.8.1
VisionSDK.Operations.Execution.OperationsExecutionScheduler Class Reference

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...

Inheritance diagram for VisionSDK.Operations.Execution.OperationsExecutionScheduler:
VisionSDK.Operations.Execution.OperationsExecutionSchedulerAsyncBackgroundWorker VisionSDK.Operations.Execution.OperationsExecutionSchedulerSync

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...
 

Detailed Description

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

Constructor & Destructor Documentation

VisionSDK.Operations.Execution.OperationsExecutionScheduler.OperationsExecutionScheduler ( IScheduler  scheduler)

Constructor

Parameters
schedulerThe IScheduler used to fire events in the right Dispatcher

Member Function Documentation

void VisionSDK.Operations.Execution.OperationsExecutionScheduler.AddOperationToExecutionQueue ( Operation  operation)

Adds an operation to the execution queue. This operaton will execute as soon as possible.

Parameters
operationThe operation to execute
virtual void VisionSDK.Operations.Execution.OperationsExecutionScheduler.ExecuteOperation ( Operation  operation)
protectedvirtual

This method must be overridden and called from the OperationExecutionScheduler subclasses when executing an operation

Parameters
operationThe operation that has started the execution

Reimplemented in VisionSDK.Operations.Execution.OperationsExecutionSchedulerAsyncBackgroundWorker, and VisionSDK.Operations.Execution.OperationsExecutionSchedulerSync.

void VisionSDK.Operations.Execution.OperationsExecutionScheduler.OnDidExecutedOperation ( Operation  operation)
protected

This method fires the "OnDidExecutedOperation" using the EventManager

Parameters
operationThe operation that has terminated the execution
void VisionSDK.Operations.Execution.OperationsExecutionScheduler.OnWillExecuteOperation ( Operation  operation)
protected

This method fires the "OnWillExecuteOperation" using the EventManager

Parameters
operationThe operation that will start the execution
void VisionSDK.Operations.Execution.OperationsExecutionScheduler.OperationExecutionCompleted ( Operation  operation)
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

Parameters
operationThe operation that has terminated the execution
virtual Operation VisionSDK.Operations.Execution.OperationsExecutionScheduler.PickOperationToExecute ( )
protectedvirtual

Returns the next operation to execute, removes it from the OperationsToExecuteQueue, then pushes it to the OperationsToExecuteQueue

Returns
The operation to execute
virtual void VisionSDK.Operations.Execution.OperationsExecutionScheduler.PrepareOperationForExecution ( Operation  operation)
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

Parameters
operationThe operation that will start the execution
void VisionSDK.Operations.Execution.OperationsExecutionScheduler.RemoveAllOperationsInQueue ( )

Removes all the operations in the execution queue that are not executing

Member Data Documentation

int VisionSDK.Operations.Execution.OperationsExecutionScheduler.maxSimultaneousOperations
protected

Property Documentation

Boolean VisionSDK.Operations.Execution.OperationsExecutionScheduler.CanPerformOperations
getprotected

True if currently executing fewer operations than the MaxSimultaneousOperations

EventsScheduler VisionSDK.Operations.Execution.OperationsExecutionScheduler.EventManager
getset

Fire the events on the right Dispatcher

Boolean VisionSDK.Operations.Execution.OperationsExecutionScheduler.IsExecutingOperations
get

True if currently executing operations

int VisionSDK.Operations.Execution.OperationsExecutionScheduler.MaxSimultaneousOperations
get

Maximum number of simultaneous operations ( Default = 1 )

int VisionSDK.Operations.Execution.OperationsExecutionScheduler.NumberOfOperationsInExecution
get

Number of operations that are executing

int VisionSDK.Operations.Execution.OperationsExecutionScheduler.NumberOfOperationsInQueue
get

The number of operations in the queue waiting to be executed

List<Operation> VisionSDK.Operations.Execution.OperationsExecutionScheduler.OperationsInExecution
getsetprotected
List<Operation> VisionSDK.Operations.Execution.OperationsExecutionScheduler.OperationsToExecute
getsetprotected
IScheduler VisionSDK.Operations.Execution.OperationsExecutionScheduler.Scheduler
getset

Execute the operation's completion handler on the right Dispatcher

Event Documentation

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

HTML Footer Datalogic Automation, Inc.    ©2016 Datalogic Automation Inc. All Rights Reserved