Type-erased single-element write.
Implementations copy from in into their storage at coords if type matches their native type, otherwise no-op. in points to a caller-owned buffer of exactly sizeof(native type) bytes.
Implements MayaFlux::Kakshya::NDDataContainer.
Definition at line 862 of file SoundStreamContainer.cpp.
866{
867 if (type != typeid(double) || coords.size() != 2)
868 return;
869
870 const uint64_t frame = coords[0];
871 const uint64_t channel = coords[1];
872
874 return;
875
877
879 if (spans.empty())
880 return;
882 if (idx >= spans[0].size())
883 return;
884 const_cast<std::span<double>&>(spans[0])[idx] = *static_cast<const double*>(in);
885 } else {
886 if (channel >= spans.size() || frame >= spans[channel].size())
887 return;
888 const_cast<std::span<double>&>(spans[channel])[frame] = *static_cast<const double*>(in);
889 }
890
893}
const std::vector< std::span< double > > & get_span_cache() const
Get the cached spans for each channel, recomputing if dirty.
std::atomic< bool > m_double_extraction_dirty
void invalidate_span_cache()
Invalidate the span cache when data or layout changes.
ContainerDataStructure m_structure
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
OrganizationStrategy organization
References get_span_cache(), MayaFlux::Kakshya::INTERLEAVED, invalidate_span_cache(), m_double_extraction_dirty, m_num_channels, m_num_frames, m_structure, and MayaFlux::Kakshya::ContainerDataStructure::organization.