MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_value_impl()

void MayaFlux::Kakshya::PlotContainer::get_value_impl ( const std::vector< uint64_t > &  coords,
void *  out,
const std::type_info &  type 
) const
overrideprotectedvirtual

Type-erased single-element read.

Implementations copy the native element at coords into out if type matches their native type, otherwise no-op. out points to a caller-owned buffer of exactly sizeof(native type) bytes.

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 522 of file PlotContainer.cpp.

526{
527 if (type != typeid(double) || coords.size() < 2 || coords[0] >= m_data.size())
528 return;
529
530 const auto idx = static_cast<size_t>(coords[0]);
531
532 seqlock_read_void(m_series_locks[idx], 8, [&] {
533 const auto* vec = std::get_if<std::vector<double>>(&m_data[idx]);
534 if (!vec || coords[1] >= vec->size())
535 return;
536 *static_cast<double*>(out) = (*vec)[coords[1]];
537 });
538}
std::vector< DataVariant > m_data
Memory::SeqlockArray m_series_locks
bool seqlock_read_void(const Seqlock &lock, uint32_t max_attempts, Fn &&fn)
Invoke a void read functor under a Seqlock with a bounded retry count.
Definition SeqLock.hpp:222

References m_data, and m_series_locks.