fm.liveswitch.ManagedConcurrentQueue< T > Class Template Reference

A thread-safe queue. More...

Public Member Functions

void enqueue (T item)
 Add the item to the end of the queue. More...
 
int getCount ()
 Gets the amount of items in this queue. More...
 
boolean getIsEmpty ()
 Gets true if the queue is empty. More...
 
 ManagedConcurrentQueue ()
 Creates a new ConcurrentQueue. More...
 
boolean tryDequeue (fm.liveswitch.Holder< T > item)
 Removes and returns the item at the front of the queue. More...
 
boolean tryPeek (fm.liveswitch.Holder< T > item)
 Peeks at the first item in the queue. More...
 

Detailed Description

A thread-safe queue.

Constructor & Destructor Documentation

◆ ManagedConcurrentQueue()

Creates a new ConcurrentQueue.

Member Function Documentation

◆ enqueue()

void fm.liveswitch.ManagedConcurrentQueue< T >.enqueue ( item)

Add the item to the end of the queue.

Parameters
itemThe item to add.

◆ getCount()

int fm.liveswitch.ManagedConcurrentQueue< T >.getCount ( )

Gets the amount of items in this queue.

◆ getIsEmpty()

boolean fm.liveswitch.ManagedConcurrentQueue< T >.getIsEmpty ( )

Gets true if the queue is empty.

◆ tryDequeue()

boolean fm.liveswitch.ManagedConcurrentQueue< T >.tryDequeue ( fm.liveswitch.Holder< T >  item)

Removes and returns the item at the front of the queue.

Parameters
itemThe dequeued item.
Returns
True if item received, false if no item.

◆ tryPeek()

boolean fm.liveswitch.ManagedConcurrentQueue< T >.tryPeek ( fm.liveswitch.Holder< T >  item)

Peeks at the first item in the queue.

Parameters
itemThe item at the front of the queue.
Returns
False if queue is empty. True if first item peeked at.