Energy Core Library
Energy.Base.Queue< T > Class Template Reference

Queue More...

Inheritance diagram for Energy.Base.Queue< T >:
Energy.Interface.IQueue< T >

Public Member Functions

 Queue ()
 
 Queue (T[] list)
 
void Dispose ()
 
void Clear ()
 
bool Push (T item)
 Put element at the end of queue More...
 
bool Push (T[] array)
 Put array of elements at the end of queue More...
 
Pull ()
 Take first element from queue, remove it from queue, and finally return. More...
 
T [] Pull (int count)
 Take number of elements from queue, remove them and return array of elements taken. Pull(0) will return all elements from queue and empty it. More...
 
Pull (double timeout)
 Take element from queue with specified time limit to wait for new item to come. It will pause invoking thread as it is expected to do so. More...
 
void Back (T item)
 Put element back to queue, at begining. This element will be taken first. More...
 
void Back (T[] list)
 Put array of elements back to queue, at begining. These elements will be taken first. More...
 
Chop ()
 Delete last element from queue and return it. More...
 
T [] Chop (int count)
 Delete number of last elements from queue and return them. More...
 

Properties

bool IsEmpty [get]
 
int Name [get, set]
 
bool Circular [get, set]
 
int Count [get]
 Return number of elements in queue More...
 
int Limit [get, set]
 

Detailed Description

Constructor & Destructor Documentation

◆ Queue() [1/2]

◆ Queue() [2/2]

Energy.Base.Queue< T >.Queue ( T []  list)

Member Function Documentation

◆ Back() [1/2]

void Energy.Base.Queue< T >.Back ( item)

Put element back to queue, at begining. This element will be taken first.

Parameters
itemElement

Implements Energy.Interface.IQueue< T >.

◆ Back() [2/2]

void Energy.Base.Queue< T >.Back ( T []  list)

Put array of elements back to queue, at begining. These elements will be taken first.

Parameters
listArray of elements

Implements Energy.Interface.IQueue< T >.

◆ Chop() [1/2]

T Energy.Base.Queue< T >.Chop ( )

Delete last element from queue and return it.

Returns
Element or default if queue was empty

Implements Energy.Interface.IQueue< T >.

◆ Chop() [2/2]

T [] Energy.Base.Queue< T >.Chop ( int  count)

Delete number of last elements from queue and return them.

Parameters
countNumber of elements
Returns
Array of elements

Implements Energy.Interface.IQueue< T >.

◆ Clear()

void Energy.Base.Queue< T >.Clear ( )

◆ Dispose()

void Energy.Base.Queue< T >.Dispose ( )

◆ Pull() [1/3]

T Energy.Base.Queue< T >.Pull ( )

Take first element from queue, remove it from queue, and finally return.

Returns
Element

Implements Energy.Interface.IQueue< T >.

◆ Pull() [2/3]

T [] Energy.Base.Queue< T >.Pull ( int  count)

Take number of elements from queue, remove them and return array of elements taken. Pull(0) will return all elements from queue and empty it.

Parameters
countNumber of elements
Returns
Array of elements

Implements Energy.Interface.IQueue< T >.

◆ Pull() [3/3]

T Energy.Base.Queue< T >.Pull ( double  timeout)

Take element from queue with specified time limit to wait for new item to come. It will pause invoking thread as it is expected to do so.

Parameters
timeoutTime limit in seconds
Returns
Element or default (null) if no elements in queue

◆ Push() [1/2]

bool Energy.Base.Queue< T >.Push ( item)

Put element at the end of queue

Parameters
itemElement
Returns

Implements Energy.Interface.IQueue< T >.

◆ Push() [2/2]

bool Energy.Base.Queue< T >.Push ( T []  array)

Put array of elements at the end of queue

Using one element instead of array may be more efficient.

Parameters
arrayArray of elements
Returns

Implements Energy.Interface.IQueue< T >.

Property Documentation

◆ Circular

bool Energy.Base.Queue< T >.Circular
getset

◆ Count

int Energy.Base.Queue< T >.Count
get

Return number of elements in queue

◆ IsEmpty

bool Energy.Base.Queue< T >.IsEmpty
get

◆ Limit

int Energy.Base.Queue< T >.Limit
getset

◆ Name

int Energy.Base.Queue< T >.Name
getset

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