Class anira::v2::BufferF#
-
class BufferF#
The 2.x BufferF as a view of the model end of one slot: one channel of get_num_samples() floats, the tensor’s elements packed (every channel of a multichannel tensor lies in that one channel, channel c at [c * n, (c + 1) * n), as 2.x laid it out). Re-pointed for every phase call; valid for the duration of the call. Channel 0 is the only channel: a pointer to another is nullptr and a sample of another reads 0. Absent from the 2.x class: the owning BufferF(channels, samples) (a host buffer is the host’s own container now), swap_data, get_sample_rate.
[driver-thread | inference-thread] [callback-safe], nonblocking.
Public Functions
-
BufferF() noexcept = default#
A buffer of nothing: no elements.
-
inline BufferF(float *data, size_t num_samples) noexcept#
-
inline size_t get_num_channels() const noexcept#
-
inline size_t get_num_samples() const noexcept#
-
inline const float *get_read_pointer(size_t channel) const noexcept#
-
inline const float *get_read_pointer(size_t channel, size_t sample_index) const noexcept#
-
inline float *get_write_pointer(size_t channel) noexcept#
-
inline float *get_write_pointer(size_t channel, size_t sample_index) noexcept#
-
inline float get_sample(size_t channel, size_t sample_index) const noexcept#
One sample; 0 outside the buffer.
-
inline void set_sample(size_t channel, size_t sample_index, float value) noexcept#
One sample; nothing outside the buffer.
-
inline void clear() noexcept#
Zeroes every sample.
-
inline float *data() noexcept#
-
inline const float *data() const noexcept#
-
inline const float *const *get_array_of_read_pointers() const noexcept#
The array of the one channel pointer, valid while this view is.
-
inline float *const *get_array_of_write_pointers() noexcept#
-
BufferF() noexcept = default#