Ark Server API (ASA) - Wiki
|
#include <QueuedThreadPool.h>
Public Member Functions | |
FThreadPoolPriorityQueue () | |
void | Enqueue (IQueuedWork *InQueuedWork, EQueuedWorkPriority InPriority=EQueuedWorkPriority::Normal) |
bool | Retract (IQueuedWork *InQueuedWork) |
IQueuedWork * | Dequeue (EQueuedWorkPriority *OutDequeuedWorkPriority=nullptr) |
IQueuedWork * | Peek (EQueuedWorkPriority *OutDequeuedWorkPriority=nullptr) const |
void | Reset () |
int32 | Num () const |
void | Sort (EQueuedWorkPriority InPriorityBucket, TFunctionRef< bool(const IQueuedWork *A, const IQueuedWork *B)> Predicate) |
Private Attributes | |
int32 | FirstNonEmptyQueueIndex = 0 |
TArray< TArray< IQueuedWork * >, TInlineAllocator< static_cast< int32 >(EQueuedWorkPriority::Lowest)+1 > > | PriorityQueuedWork |
TAtomic< int32 > | NumQueuedWork |
Priority Queue tailored for FQueuedThreadPool implementation
This class is NOT thread-safe and must be properly protected.
Definition at line 51 of file QueuedThreadPool.h.
FThreadPoolPriorityQueue::FThreadPoolPriorityQueue | ( | ) |
IQueuedWork * FThreadPoolPriorityQueue::Dequeue | ( | EQueuedWorkPriority * | OutDequeuedWorkPriority = nullptr | ) |
Get the next work item in priority order.
void FThreadPoolPriorityQueue::Enqueue | ( | IQueuedWork * | InQueuedWork, |
EQueuedWorkPriority | InPriority = EQueuedWorkPriority::Normal ) |
Enqueue a work item at specified priority
|
inline |
Get the total number of queued items.
Definition at line 84 of file QueuedThreadPool.h.
IQueuedWork * FThreadPoolPriorityQueue::Peek | ( | EQueuedWorkPriority * | OutDequeuedWorkPriority = nullptr | ) | const |
Get the next work item in priority order without actually dequeuing.
void FThreadPoolPriorityQueue::Reset | ( | ) |
Empty the queue.
bool FThreadPoolPriorityQueue::Retract | ( | IQueuedWork * | InQueuedWork | ) |
Search and remove a queued work item from the list
void FThreadPoolPriorityQueue::Sort | ( | EQueuedWorkPriority | InPriorityBucket, |
TFunctionRef< bool(const IQueuedWork *A, const IQueuedWork *B)> | Predicate ) |
Sort Priority Bucket given Predicate
|
private |
The first queue to extract a work item from to avoid scanning all priorities when unqueuing.
Definition at line 92 of file QueuedThreadPool.h.
Definition at line 94 of file QueuedThreadPool.h.
|
private |
Definition at line 93 of file QueuedThreadPool.h.