![]() |
Deluge Firmware 1.3.0
Build date: 2026.10.18
|
#include <cluster_priority_queue.h>


Public Member Functions | |
| Error | enqueueCluster (Cluster &cluster, uint32_t priorityRating, const InterruptsDisabled &) |
| bool | empty () const |
| Not exact unless interrupts are disabled, as the SD interrupt may be taking one off. | |
| std::optional< qcluster > | popForLoading (const InterruptsDisabled &) |
| Takes the highest priority Cluster that still wants loading off the queue. For the SD interrupt, so doesn't allocate or free anything - unwanted ones are just dropped, as they've already been taken care of by whatever made them unwanted. | |
| bool | hasAnyWithPriority (Priority priority, const InterruptsDisabled &) const |
Whether any Cluster is queued at exactly priority. Has to check every entry, as the heap only keeps the front in order. | |
| bool | raisePriority (const Cluster *cluster, Priority priorityRating, const InterruptsDisabled &) |
If cluster is queued at a lower priority than priorityRating, moves it up to that. | |
| std::optional< Priority > | take (const Cluster *cluster, const InterruptsDisabled &) |
Takes cluster out of the queue, e.g. to load it right away. | |
| bool | erase (const Cluster *cluster, const InterruptsDisabled &) |
Clusters waiting to be read from the card. The main thread adds them, and the SD interrupt takes them off the front with popForLoading() as it gets to them - so everything here has to be done with interrupts disabled.
|
inline |
Takes the highest priority Cluster that still wants loading off the queue. For the SD interrupt, so doesn't allocate or free anything - unwanted ones are just dropped, as they've already been taken care of by whatever made them unwanted.
|
inline |
If cluster is queued at a lower priority than priorityRating, moves it up to that.
Enqueuing it again instead would get it loaded twice, which corrupts any data that gets converted on load.
|
inline |
Takes cluster out of the queue, e.g. to load it right away.