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 832 of file SoundStreamContainer.cpp.
836{
837 if (
type !=
typeid(
double) || coords.size() != 2 || !
has_data())
838 return;
839
840 const uint64_t frame = coords[0];
841 const uint64_t channel = coords[1];
842
844 return;
845
847
849 if (spans.empty())
850 return;
852 if (idx >= spans[0].size())
853 return;
854 *static_cast<double*>(out) = spans[0][idx];
855 } else {
856 if (channel >= spans.size() || frame >= spans[channel].size())
857 return;
858 *static_cast<double*>(out) = spans[channel][frame];
859 }
860}
vk::PhysicalDeviceType type
const std::vector< std::span< double > > & get_span_cache() const
Get the cached spans for each channel, recomputing if dirty.
bool has_data() const override
Check if the container currently holds any data.
ContainerDataStructure m_structure
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
OrganizationStrategy organization
References get_span_cache(), has_data(), MayaFlux::Kakshya::INTERLEAVED, m_num_channels, m_num_frames, m_structure, MayaFlux::Kakshya::ContainerDataStructure::organization, and type.