Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
Cluster Class Referencefinal

#include <cluster.h>

Inheritance diagram for Cluster:
Collaboration diagram for Cluster:

Public Types

enum class  Type {
  EMPTY , SAMPLE , GENERAL_MEMORY , SAMPLE_CACHE ,
  PERC_CACHE_FORWARDS , PERC_CACHE_REVERSED , OTHER
}
 
- Public Types inherited from Stealable
using link_type = etl::bidirectional_link<0>
 

Public Member Functions

void destroy ()
 
 Cluster ()=default
 
void convertDataIfNecessary ()
 This function goes through the contents of the cluster, and converts them to the Deluge's native PCM 24-bit format if needed.
 
bool mayBeStolen (void *thingNotToStealFrom) override
 
void steal (char const *errorCode) override
 
StealableQueue getAppropriateQueue () const override
 
void addReason ()
 
- Public Member Functions inherited from Stealable
bool operator== (const Stealable &other) const
 Object equality is based on pointer equality.
 

Static Public Member Functions

static Clustercreate (Cluster::Type type=Cluster::Type::SAMPLE, bool shouldAddReasons=true, void *dontStealFromThing=nullptr)
 
static void setSize (size_t size)
 

Public Attributes

Cluster::Type type
 
uint32_t clusterIndex = 0
 
int32_t numReasonsToBeLoaded = 0
 
int8_t numReasonsHeldBySampleRecorder = 0
 
bool extraBytesAtStartConverted = false
 
bool extraBytesAtEndConverted = false
 
Samplesample = nullptr
 
SampleCachesampleCache = nullptr
 
char firstThreeBytesPreDataConversion [3]
 
bool loaded = false
 
char dummy [CACHE_LINE_SIZE]
 
char data [CACHE_LINE_SIZE]
 
- Public Attributes inherited from Stealable
uint32_t lastTraversalNo = 0xFFFFFFFF
 

Static Public Attributes

static constexpr size_t kSizeFAT16Max = 32768
 
static size_t size = 32768
 
static size_t size_magnitude = 15
 

Detailed Description

Header data for a cluster. The actual cluster data is expected to be in the same allocation, after this class member. To correctly allocate an instance of this class, you must also allocate Cluster::size bytes with enough padding to safely absorb an offset of at least CACHE_LINE_SIZE.

Constructor & Destructor Documentation

◆ Cluster()

Cluster::Cluster ( )
default

Warning! do not call this constructor directly! It must be called via placement new after allocating a region with the General Memory Allocator!

Member Function Documentation

◆ getAppropriateQueue()

StealableQueue Cluster::getAppropriateQueue ( ) const
nodiscardoverridevirtual

Implements Stealable.

◆ mayBeStolen()

bool Cluster::mayBeStolen ( void * thingNotToStealFrom)
overridevirtual

Implements Stealable.

◆ steal()

void Cluster::steal ( char const * errorCode)
overridevirtual

Implements Stealable.


The documentation for this class was generated from the following files: