12#ifndef JAU_MATH_UTIL_SYNCBUFFER_HPP_
13#define JAU_MATH_UTIL_SYNCBUFFER_HPP_
53 virtual const
void*
data() const noexcept = 0;
86 std::enable_if_t<std::is_floating_point_v<Value_type>,
bool> =
true>
98 const void*
data() const noexcept
override {
return floats(); }
112 .append(
", count ").append(std::to_string(
elementCount()))
113 .append(
" elem x ").append(std::to_string(
compsPerElem()))
114 .append(
" comp x ").append(std::to_string(
bytesPerComp()))
115 .append(
" = ").append(std::to_string(
byteCount())).append(
" bytes]");
123 std::enable_if_t<std::is_floating_point_v<Value_type>,
bool> =
true>
137 const void*
data() const noexcept
override {
return floats(); }
151 .append(
", count ").append(std::to_string(
elementCount()))
152 .append(
" elem x ").append(std::to_string(
compsPerElem()))
153 .append(
" comp x ").append(std::to_string(
bytesPerComp()))
154 .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).
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.
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.
size_t byteCount() const noexcept
Returns the byte size of all elements, i.e.
const value_type * floats() const noexcept
virtual size_t matrixCount() const noexcept=0
const void * data() const noexcept override
Return the underlying data buffer as bytes w/o sync action().
size_t bytesPerComp() const noexcept
The component's size in bytes.
virtual const Mat4 * matrices() const noexcept=0
Return the underlying Mat4 pointer, used to synchronize via action() to the buffer().
Matrix4< value_type, std::is_floating_point_v< value_type > > Mat4
std::string toString() const override
const jau::type_info & compSignature() const noexcept override
Returns type signature of implementing class's stored component value type.
size_t compsPerElem() const noexcept
The number of components per element.
size_t elementCount() const noexcept
Returns element count.
SyncBuffer interface with a single underlying Matrix4.
Matrix4< value_type, std::is_floating_point_v< value_type > > Mat4
size_t byteCount() const noexcept
Returns the byte size of all elements, i.e.
virtual const Mat4 & matrix() const noexcept=0
Return the underlying Mat4, used to synchronize via action() to the buffer().
std::string toString() const override
size_t compsPerElem() const noexcept
The number of components per element.
const value_type * floats() const noexcept
size_t bytesPerComp() const noexcept
The component's size in bytes.
const void * data() const noexcept override
Return the underlying data buffer as bytes w/o sync action().
const jau::type_info & compSignature() const noexcept override
Returns type signature of implementing class's stored component value type.
size_t elementCount() const noexcept
Returns element count.
Generic type information using either Runtime type information (RTTI) or Compile time type informatio...
const jau::type_info & static_ctti() noexcept
Returns a static global reference of make_ctti<T>(true) w/ identity instance.
constexpr std::string_view name(const Bool v) noexcept
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