Craig's Utility Library  4.0 Beta
Utilities.DataTypes.TaskQueue< T > Class Template Reference

Class that helps with running tasks in parallel on a set of objects (that will come in on an ongoing basis, think producer/consumer situations) More...

Inheritance diagram for Utilities.DataTypes.TaskQueue< T >:

Public Member Functions

 TaskQueue (int Capacity, Action< T > ProcessItem, Action< Exception > HandleError=null)
 Constructor More...
 
void Cancel (bool Wait=false)
 Cancels the queue from processing More...
 
void Enqueue (T Item)
 Adds the item to the queue to be processed More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Disposes of the objects More...
 

Properties

bool IsCanceled [get]
 Determines if it has been cancelled More...
 
bool IsComplete [get]
 Determines if it has completed all tasks More...
 

Detailed Description

Class that helps with running tasks in parallel on a set of objects (that will come in on an ongoing basis, think producer/consumer situations)

Template Parameters
TObject type to process

Definition at line 36 of file TaskQueue.cs.

Constructor & Destructor Documentation

Utilities.DataTypes.TaskQueue< T >.TaskQueue ( int  Capacity,
Action< T >  ProcessItem,
Action< Exception >  HandleError = null 
)

Constructor

Parameters
CapacityNumber of items that are allowed to be processed in the queue at one time
ProcessItemAction that is used to process each item
HandleErrorHandles an exception if it occurs (defaults to eating the error)

Definition at line 48 of file TaskQueue.cs.

Member Function Documentation

void Utilities.DataTypes.TaskQueue< T >.Cancel ( bool  Wait = false)

Cancels the queue from processing

Parameters
WaitDetermines if the function should wait for the tasks to complete before returning

Definition at line 101 of file TaskQueue.cs.

override void Utilities.DataTypes.TaskQueue< T >.Dispose ( bool  disposing)
protected

Disposes of the objects

Parameters
disposingTrue to dispose of all resources, false only disposes of native resources

Definition at line 126 of file TaskQueue.cs.

void Utilities.DataTypes.TaskQueue< T >.Enqueue ( Item)

Adds the item to the queue to be processed

Parameters
ItemItem to process

Definition at line 114 of file TaskQueue.cs.

Property Documentation

bool Utilities.DataTypes.TaskQueue< T >.IsCanceled
get

Determines if it has been cancelled

Definition at line 63 of file TaskQueue.cs.

bool Utilities.DataTypes.TaskQueue< T >.IsComplete
get

Determines if it has completed all tasks

Definition at line 71 of file TaskQueue.cs.


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