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< DataVariant >.
Definition at line 899 of file SoundStreamContainer.cpp.
903{
904 if (
type !=
typeid(
double) ||
coords.size() != 2)
905 return;
906
907 const uint64_t frame =
coords[0];
908 const uint64_t channel =
coords[1];
909
911 return;
912
914
916 if (spans.empty())
917 return;
919 if (idx >= spans[0].
size())
920 return;
921 const_cast<std::span<double>&>(spans[0])[idx] = *static_cast<const double*>(in);
922 } else {
923 if (channel >= spans.size() || frame >= spans[channel].size())
924 return;
925 const_cast<std::span<double>&>(spans[channel])[frame] = *static_cast<const double*>(in);
926 }
927
930}
std::vector< glm::ivec3 > coords
vk::PhysicalDeviceType type
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 coords, get_span_cache(), MayaFlux::Kakshya::INTERLEAVED, invalidate_span_cache(), m_double_extraction_dirty, m_num_channels, m_num_frames, m_structure, MayaFlux::Kakshya::ContainerDataStructure::organization, size, and type.