KS.Reactor.ksAtomicQueue< T > Class Template Reference

Wraps a Queue to make all read/write operations thread safe. More...

Public Member Functions

void Enqueue (T value)
 Adds a value to the end of the queue. More...
 
Dequeue ()
 Removes the first value in the queue. More...
 
bool TryDequeue (out T outValue)
 Tries to remove and return the object at the beginning of the queue. More...
 
Peek ()
 Returns the first value without removing it from the queue. More...
 
void Clear ()
 Removes everything from the queue. More...
 
T[] ToArray ()
 Converts the queueto an array. More...
 

Properties

int Count [get]
 Number of values in the queue. More...
 

Detailed Description

Wraps a Queue to make all read/write operations thread safe.

Template Parameters
T

Member Function Documentation

◆ Clear()

void KS.Reactor.ksAtomicQueue< T >.Clear ( )

Removes everything from the queue.

◆ Dequeue()

T KS.Reactor.ksAtomicQueue< T >.Dequeue ( )

Removes the first value in the queue.

Returns
Value removed from the queue.

◆ Enqueue()

void KS.Reactor.ksAtomicQueue< T >.Enqueue ( value)

Adds a value to the end of the queue.

Parameters
valueValue to add.

◆ Peek()

T KS.Reactor.ksAtomicQueue< T >.Peek ( )

Returns the first value without removing it from the queue.

Returns
First value in queue.

◆ ToArray()

T [] KS.Reactor.ksAtomicQueue< T >.ToArray ( )

Converts the queueto an array.

Returns
An array of all the data in the queue.

◆ TryDequeue()

bool KS.Reactor.ksAtomicQueue< T >.TryDequeue ( out T  outValue)

Tries to remove and return the object at the beginning of the queue.

Parameters
outValueIf the operation was successful, outValue contains the object removed. If no object was available to be removed, the value is the default T value.
Returns
True if an element was removed and returned from the beginning of the queue.

Property Documentation

◆ Count

int KS.Reactor.ksAtomicQueue< T >.Count
get

Number of values in the queue.