12#ifndef JAU_MATH_UTIL_SYNCBUFFER_HPP_
13#define JAU_MATH_UTIL_SYNCBUFFER_HPP_
54 virtual const
void*
data() const noexcept = 0;
86 template <jau::req::packed_
floating_po
int Value_type>
99 : m_mat(first), m_count(count), m_sync(
std::move(s)) {}
110 const void*
data() const noexcept
override {
return floats(); }
125 .append(
", count ").append(std::to_string(
elementCount()))
126 .append(
" elem x ").append(std::to_string(
compsPerElem()))
127 .append(
" comp x ").append(std::to_string(
bytesPerComp()))
128 .append(
" = ").append(std::to_string(
byteCount())).append(
" bytes]");
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).
Convenient tuple of a sync_action_t and data buffer.
virtual sync_action_t & action() noexcept=0
Return the defined sync_action_t.
const void * syncedData() noexcept
Return the underlying data buffer as bytes after invoking sync action().
virtual const jau::type_info & compSignature() const noexcept=0
Returns type signature of implementing class's stored component value type.
virtual ~SyncBuffer() noexcept=default
SyncBuffer & sync() noexcept
The component's size in bytes.
virtual std::string toString() const =0
virtual const void * data() const noexcept=0
Return the underlying data buffer as bytes w/o sync action().
SyncBuffer interface with multiple underlying Matrix4.
Matrix4< value_type > Mat4
const jau::type_info & compSignature() const noexcept override
Returns the component's value_type signature.
const void * data() const noexcept override
Return the underlying data buffer as bytes w/o sync action().
constexpr size_t matrixCount() const noexcept
Return the number of Mat4 referenced by matrices()
constexpr size_t byteCount() const noexcept
Returns the byte size of all elements, i.e.
std::string toString() const override
constexpr size_t bytesPerComp() const noexcept
The component's size in bytes.
SyncMatrices4(const Mat4 &first, size_t count, sync_action_t s=sync_action_t())
sync_action_t & action() noexcept override
Return the defined sync_action_t.
constexpr const value_type * floats() const noexcept
Return the underlying float data buffer.
constexpr size_t elementCount() const noexcept
Returns element count.
constexpr const Mat4 * matrices() const noexcept
Return the underlying Mat4 pointer, used to synchronize via action() to the buffer().
constexpr size_t compsPerElem() const noexcept
The number of components per element.
Generic type information using either Runtime type information (RTTI) or Compile time type informatio...
consteval_cxx20 std::string_view name() noexcept
const jau::type_info & static_ctti() noexcept
Returns a static global reference of make_ctti<T>(true) w/ identity instance.
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.