MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.common.BlockingQueue< T > Class Template Reference

The BlockingQueue is used for synchronized Queue operations. More...

Inheritance diagram for MyCaffe.common.BlockingQueue< T >:

Public Member Functions

 BlockingQueue (CancelEvent evtCancel)
 The BlockingQueue constructor. More...
 
void Reset ()
 Reset the abort event. More...
 
void Abort ()
 Cancel the blocking queue operations. More...
 
bool GetAt (int nIdx, ref T t)
 Returns the item at a given index within the queue. More...
 
void Clear ()
 Remove all items from the queue. More...
 
void Push (T t)
 Add an item to the back of the queue. More...
 
bool Pop (ref T t)
 Remove an item from the front of the queue. More...
 
bool Peek (ref T t)
 Retrieve an item from the front of the queue, but do not remove it. More...
 
void Dispose ()
 Release all resources used by the queue. More...
 

Protected Member Functions

virtual void Dispose (bool bDisposing)
 Release all resources used by the queue. More...
 

Properties

int Count [get]
 Return the number of items in the queue. More...
 

Detailed Description

The BlockingQueue is used for synchronized Queue operations.

Template Parameters
TSpecifies the base type float or double. Using float is recommended to conserve GPU memory.

Definition at line 14 of file BlockingQueue.cs.

Constructor & Destructor Documentation

◆ BlockingQueue()

The BlockingQueue constructor.

Parameters
evtCancelSpecifies a CancelEvent used to terminate wait sates within the Queue.

Definition at line 27 of file BlockingQueue.cs.

Member Function Documentation

◆ Abort()

void MyCaffe.common.BlockingQueue< T >.Abort ( )

Cancel the blocking queue operations.

Definition at line 43 of file BlockingQueue.cs.

◆ Clear()

void MyCaffe.common.BlockingQueue< T >.Clear ( )

Remove all items from the queue.

Definition at line 102 of file BlockingQueue.cs.

◆ Dispose() [1/2]

void MyCaffe.common.BlockingQueue< T >.Dispose ( )

Release all resources used by the queue.

Definition at line 223 of file BlockingQueue.cs.

◆ Dispose() [2/2]

virtual void MyCaffe.common.BlockingQueue< T >.Dispose ( bool  bDisposing)
protectedvirtual

Release all resources used by the queue.

Parameters
bDisposingSet to true when called from Dispose().

Definition at line 201 of file BlockingQueue.cs.

◆ GetAt()

bool MyCaffe.common.BlockingQueue< T >.GetAt ( int  nIdx,
ref T  t 
)

Returns the item at a given index within the queue.

Parameters
nIdxSpecifies the index.
tSpecifies the data value at the index.
Returns
If the CancelEvent is null or is set, false is returned, otherwise if the data is successfully retrieved true is returned.

Definition at line 62 of file BlockingQueue.cs.

◆ Peek()

bool MyCaffe.common.BlockingQueue< T >.Peek ( ref T  t)

Retrieve an item from the front of the queue, but do not remove it.

This function will wait until either data is added to the queue or the CancelEvent or AbortEvent are set.

Parameters
tSpecifies the item removed.
Returns
If a CancelEvent occurs, false is returned, otherwise if the data is successfully removed from the queue true is returned.

Definition at line 177 of file BlockingQueue.cs.

◆ Pop()

bool MyCaffe.common.BlockingQueue< T >.Pop ( ref T  t)

Remove an item from the front of the queue.

This function will wait until either data is added to the queue or the CancelEvent or AbortEvent are set.

Parameters
tSpecifies the item removed.
Returns
If a CancelEvent occurs, false is returned, otherwise if the data is successfully removed from the queue true is returned.

Definition at line 136 of file BlockingQueue.cs.

◆ Push()

void MyCaffe.common.BlockingQueue< T >.Push ( t)

Add an item to the back of the queue.

Parameters
tSpecifies the item to add.

Definition at line 115 of file BlockingQueue.cs.

◆ Reset()

void MyCaffe.common.BlockingQueue< T >.Reset ( )

Reset the abort event.

Definition at line 35 of file BlockingQueue.cs.

Property Documentation

◆ Count

int MyCaffe.common.BlockingQueue< T >.Count
get

Return the number of items in the queue.

Definition at line 51 of file BlockingQueue.cs.


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