Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::internal::AtomicDoubleWithBool Class Reference

Stores a double and a bool in a single atomic uint64_t. More...

#include <src/dsp/atomic_position.h>

Public Member Functions

 AtomicDoubleWithBool (double d, bool b) noexcept
void store (double d, bool b) noexcept
std::pair< double, bool > load () const noexcept

Detailed Description

Stores a double and a bool in a single atomic uint64_t.

The bool is stored in bit 0, and the double's LSB is cleared to make room. This causes up to 1 ULP of precision loss on the stored double, which is acceptable for DAW position values (far below sample-level precision). The error does not accumulate across repeated store/load cycles.

Definition at line 38 of file atomic_position.h.

Constructor & Destructor Documentation

◆ AtomicDoubleWithBool()

zrythm::dsp::internal::AtomicDoubleWithBool::AtomicDoubleWithBool ( double d,
bool b )
inlinenoexcept

Definition at line 47 of file atomic_position.h.

Member Function Documentation

◆ load()

std::pair< double, bool > zrythm::dsp::internal::AtomicDoubleWithBool::load ( ) const
inlinenoexcept

Definition at line 56 of file atomic_position.h.

◆ store()

void zrythm::dsp::internal::AtomicDoubleWithBool::store ( double d,
bool b )
inlinenoexcept

Definition at line 49 of file atomic_position.h.


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