MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_null()

bool MayaFlux::Kakshya::CompositeArray::set_null ( size_t  index,
std::string_view  field_name 
)

Write a present NULL to a dynamic field.

Definition at line 224 of file Composite.cpp.

225{
226 const auto field_index = validate_dynamic_write(index, field_name);
227 if (!field_index)
228 return false;
229 const auto& field = m_layout.fields()[*field_index];
230 const DynamicCell cell { null_kind, 0, 0 };
231 auto& rows = std::get<std::vector<uint8_t>>(m_rows);
232 std::memcpy(rows.data() + index * m_layout.stride_bytes() + field.offset_bytes, &cell, sizeof(cell));
233 set_present(index, *field_index, true);
234 return true;
235}
uint32_t rows
uint32_t index
Definition VKDevice.cpp:122
void set_present(size_t index, size_t field_index, bool present) noexcept
std::optional< size_t > validate_dynamic_write(size_t index, std::string_view field_name) const
size_t stride_bytes() const noexcept
Bytes per packed element after finalization.
Definition Composite.hpp:86
const std::vector< CompositeField > & fields() const noexcept
Declared fields in element order, with finalized byte offsets.
Definition Composite.hpp:82

References MayaFlux::Kakshya::CompositeLayout::fields(), index, m_layout, m_rows, rows, set_present(), MayaFlux::Kakshya::CompositeLayout::stride_bytes(), and validate_dynamic_write().

+ Here is the call graph for this function: