Deluge Firmware 1.3.0
Build date: 2026.11.28
Loading...
Searching...
No Matches
deluge::note_locks::Pool Class Reference

The lock sets of every Note in one Song (or of the notes on the clipboard). Sets are only ever added. More...

#include <note_locks.h>

Public Member Functions

 Pool (Pool &&)=default
Pool & operator= (Pool &&)=default
 Pool (const Pool &)=delete
Pool & operator= (const Pool &)=delete
std::optional< uint16_t > intern (const LockSet &locks)
LockSet get (uint16_t index) const
 Empty for index 0 or an out-of-range index, so a stale index can never read outside the pool.
int32_t numSets () const

Private Types

template<typename T>
using Array = std::vector<T, memory::sdram_allocator<T>>

Private Member Functions

uint16_t lookup (uint32_t hash, const LockSet &locks) const
void addToHash (uint32_t hash, uint16_t index)
void rehash (uint32_t newCapacity)

Private Attributes

Array< uint32_t > words_
Array< uint32_t > offsets_
Array< uint16_t > hash_

Detailed Description

The lock sets of every Note in one Song (or of the notes on the clipboard). Sets are only ever added.

Member Function Documentation

◆ intern()

std::optional< uint16_t > deluge::note_locks::Pool::intern ( const LockSet & locks)
nodiscard

The index of the entry equal to locks, adding one if there isn't one yet. 0 for an empty set. nullopt if the pool is out of memory or indices: the caller should then leave its note's locks as they were.


The documentation for this class was generated from the following files:
  • src/deluge/model/note/note_locks.h
  • src/deluge/model/note/note_locks.cpp