MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kakshya::CompositeInsertion Class Reference

Mutable insertion adapter for a CompositeArray. More...

#include <CompositeInsertion.hpp>

+ Collaboration diagram for MayaFlux::Kakshya::CompositeInsertion:

Public Member Functions

size_t append ()
 Append an empty element.
 
std::optional< size_t > append (const Composite &source)
 Copy one Composite with a matching layout into this array.
 
bool clear (size_t index, std::string_view field_name)
 Mark a named field absent in an existing element.
 
 CompositeInsertion (CompositeArray &array) noexcept
 Borrow the array into which elements and fields will be written.
 
template<typename T >
requires ArithmeticData<T>
bool set (size_t index, std::string_view field_name, T value)
 Write an arithmetic field of an existing element.
 
bool set_blob (size_t index, std::string_view field_name, std::span< const uint8_t > value)
 Write binary bytes to a fixed or dynamic BLOB field.
 
bool set_null (size_t index, std::string_view field_name)
 Write a present NULL to a dynamic field.
 
bool set_text (size_t index, std::string_view field_name, std::string_view value)
 Write UTF-8 bytes to a std::string field.
 

Private Attributes

CompositeArray * m_array
 

Detailed Description

Mutable insertion adapter for a CompositeArray.

Appends empty elements, writes fields by name, and copies compatible Composite values from another array. Copying an element also copies its present text values and rebases their offsets into the destination's text store. The adapter borrows its destination array and does not own storage.

Usage:

CompositeInsertion insert(items);
auto index = insert.append();
insert.set_text(index, "name", "Ada");
insert.set(index, "score", 0.95);
uint32_t index
Definition VKDevice.cpp:122
Mutable insertion adapter for a CompositeArray.

Copying between arrays with the same finalized layout:

CompositeInsertion destination_insert(destination);
auto source = items.at(0);
auto copied_index = destination_insert.append(*source);
Note
The destination CompositeArray must outlive this adapter. Field writes require exact declared types; they never coerce numeric values.

Definition at line 34 of file CompositeInsertion.hpp.


The documentation for this class was generated from the following files: