CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
ExecutionQueue< T, MaxDepth > Class Template Reference

Execution queue implementation. More...

#include <execution_queue.hpp>

Public Member Functions

bool enqueuePending (const T &item)
 Enqueue an item into the "pending" queue.
 
bool dequeuePending (T &item)
 Dequeue an item from the "pending" queue.
 
bool movePendingToReady ()
 Move an item from the "pending" queue to the "ready" queue.
 
bool enqueueReady (const T &item)
 Enqueue an item into the "ready" queue.
 
bool dequeueReady (T &item)
 Dequeue an item from the "ready" queue for processing.
 
bool peekReady (T &item) const
 Peek at the item at the front of the "ready" queue without removing it.
 
bool enqueueDone (const T &item)
 Enqueue an item into the "done" queue after processing.
 
bool dequeueDone (T &item)
 Dequeue an item from the "done" queue.
 
void waitForDoneRef ()
 Block until at least one item is available in the "done" queue.
 
bool moveReadyToDone ()
 Move an item from the "ready" queue to the "done" queue.
 
bool isPendingEmpty () const
 Check if the "pending" queue is empty.
 
bool isReadyEmpty () const
 Check if the "ready" queue is empty.
 
bool isDoneEmpty () const
 Check if the "done" queue is empty.
 
std::size_t pendingQueueSize () const
 Get the size of the "pending" queue.
 
std::size_t readyQueueSize () const
 Get the size of the "ready" queue.
 
std::size_t doneQueueSize () const
 Get the size of the "done" queue.
 

Detailed Description

template<typename T, std::size_t MaxDepth>
class ExecutionQueue< T, MaxDepth >

Execution queue implementation.

Template Parameters
Tqueue type
MaxDepthdepth of queue

Member Function Documentation

◆ dequeueDone()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::dequeueDone ( T & item)
inline

Dequeue an item from the "done" queue.

Parameters
itemReference to store the dequeued item
Returns
true if successful, false if the queue is empty

◆ dequeuePending()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::dequeuePending ( T & item)
inline

Dequeue an item from the "pending" queue.

Parameters
itemReference to store the dequeued item
Returns
true if successful, false if the queue is empty

◆ dequeueReady()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::dequeueReady ( T & item)
inline

Dequeue an item from the "ready" queue for processing.

Parameters
itemReference to store the dequeued item
Returns
true if successful, false if the queue is empty

◆ doneQueueSize()

template<typename T, std::size_t MaxDepth>
std::size_t ExecutionQueue< T, MaxDepth >::doneQueueSize ( ) const
inline

Get the size of the "done" queue.

Returns
std::size_t Size of the "done" queue

◆ enqueueDone()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::enqueueDone ( const T & item)
inline

Enqueue an item into the "done" queue after processing.

Parameters
itemThe item to enqueue
Returns
true if successful, false if the queue is full

◆ enqueuePending()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::enqueuePending ( const T & item)
inline

Enqueue an item into the "pending" queue.

Parameters
itemThe item to enqueue
Returns
true if successful, false if the queue is full

◆ enqueueReady()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::enqueueReady ( const T & item)
inline

Enqueue an item into the "ready" queue.

Parameters
itemThe item to enqueue
Returns
true if successful, false if the queue is full

◆ isDoneEmpty()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::isDoneEmpty ( ) const
inline

Check if the "done" queue is empty.

Returns
true if empty, false otherwise

◆ isPendingEmpty()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::isPendingEmpty ( ) const
inline

Check if the "pending" queue is empty.

Returns
true if empty, false otherwise

◆ isReadyEmpty()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::isReadyEmpty ( ) const
inline

Check if the "ready" queue is empty.

Returns
true if empty, false otherwise

◆ movePendingToReady()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::movePendingToReady ( )
inline

Move an item from the "pending" queue to the "ready" queue.

Returns
true if successful, false if the "pending" queue is empty or the "ready" queue is full

◆ moveReadyToDone()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::moveReadyToDone ( )
inline

Move an item from the "ready" queue to the "done" queue.

Returns
true if successful, false if the "ready" queue is empty or the "done" queue is full

◆ peekReady()

template<typename T, std::size_t MaxDepth>
bool ExecutionQueue< T, MaxDepth >::peekReady ( T & item) const
inline

Peek at the item at the front of the "ready" queue without removing it.

Parameters
itemReference to store the peeked item
Returns
true if successful, false if the queue is empty

◆ pendingQueueSize()

template<typename T, std::size_t MaxDepth>
std::size_t ExecutionQueue< T, MaxDepth >::pendingQueueSize ( ) const
inline

Get the size of the "pending" queue.

Returns
std::size_t Size of the "pending" queue

◆ readyQueueSize()

template<typename T, std::size_t MaxDepth>
std::size_t ExecutionQueue< T, MaxDepth >::readyQueueSize ( ) const
inline

Get the size of the "ready" queue.

Returns
std::size_t Size of the "ready" queue

◆ waitForDoneRef()

template<typename T, std::size_t MaxDepth>
void ExecutionQueue< T, MaxDepth >::waitForDoneRef ( )
inline

Block until at least one item is available in the "done" queue.