24#ifndef JAU_SYNCBUFFER_HPP_
25#define JAU_SYNCBUFFER_HPP_
34#include <initializer_list>
70 virtual const
void*
buffer() const noexcept = 0;
89 std::enable_if_t<std::is_floating_point_v<Value_type>,
bool> =
true>
102 size_t elementSize() const noexcept
override {
return sizeof(float); }
110 std::enable_if_t<std::is_floating_point_v<Value_type>,
bool> =
true>
123 size_t elementSize() const noexcept
override {
return sizeof(float); }
Class template jau::function is a general-purpose static-polymorphic function wrapper.
Basic 4x4 value_type matrix implementation using fields for intensive use-cases (host operations).
constexpr const_iterator cbegin() const noexcept
Convenient tuple of a sync_action_t and data buffer.
virtual sync_action_t & action() noexcept=0
Return the defined sync_action_t.
virtual ~SyncBuffer() noexcept=default
virtual const void * buffer() const noexcept=0
Return the underlying data buffer.
SyncBuffer & sync() noexcept
Synchronizes the underlying data before usage.
virtual size_t elementSize() const noexcept=0
Returns element size in bytes.
virtual size_t elementCount() const noexcept=0
Returns element count, total byte size = elementSize() * elementCount()
SyncBuffer interface with multiple underlying Matrix4.
size_t elementSize() const noexcept override
Returns element size in bytes.
const void * buffer() const noexcept override
Return the underlying data buffer.
virtual size_t matrixCount() const noexcept=0
Return the number of Mat4 referenced by matrices()
const float * floats() const noexcept
virtual const Mat4 * matrices() const noexcept=0
Return the underlying Mat4 pointer, used to synchronize via action() to the buffer().
size_t elementCount() const noexcept override
Returns element count, total byte size = elementSize() * elementCount()
Matrix4< value_type, std::is_floating_point_v< Value_type > > Mat4
SyncBuffer interface with a single underlying Matrix4.
size_t elementCount() const noexcept override
Returns element count, total byte size = elementSize() * elementCount()
virtual const Mat4 & matrix() const noexcept=0
Return the underlying Mat4, used to synchronize via action() to the buffer().
const void * buffer() const noexcept override
Return the underlying data buffer.
const value_type * floats() const noexcept
Return the underlying float data buffer.
Matrix4< value_type, std::is_floating_point_v< Value_type > > Mat4
size_t elementSize() const noexcept override
Returns element size in bytes.
SyncMatrices4< float > SyncMats4f
jau::function< void()> sync_action_t
Specific data synchronization action implemented by the data provider to update the buffer with the u...
void(* sync_action_fptr)()
Plain function pointer type matching sync_action_t.
SyncMatrix4< float > SyncMat4f