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

◆ validate_write()

std::optional< size_t > MayaFlux::Kakshya::CompositeArray::validate_write ( size_t  index,
std::string_view  field_name,
std::type_index  type 
) const
private

Definition at line 153 of file Composite.cpp.

155{
156 if (index >= size()) {
158 "CompositeArray: element {} is out of range for {} elements", index, size());
159 return std::nullopt;
160 }
161
162 const auto field_index = m_layout.find_field(field_name);
163 if (!field_index) {
165 "CompositeArray: field '{}' does not exist", field_name);
166 return std::nullopt;
167 }
168
169 const auto& field = m_layout.fields()[*field_index];
170 if (field.type != type) {
172 "CompositeArray: field '{}' expects type '{}', received '{}'",
173 field_name, field.type.name(), type.name());
174 return std::nullopt;
175 }
176
177 return field_index;
178}
#define MF_WARN(comp, ctx,...)
vk::PhysicalDeviceType type
Definition VKDevice.cpp:126
uint32_t index
Definition VKDevice.cpp:122
size_t size() const noexcept
Number of packed elements.
const std::vector< CompositeField > & fields() const noexcept
Declared fields in element order, with finalized byte offsets.
Definition Composite.hpp:82
std::optional< size_t > find_field(std::string_view name) const noexcept
Find a field index by name, or std::nullopt if absent.
Definition Composite.cpp:54
@ Runtime
General runtime operations (default fallback)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References MayaFlux::Kakshya::CompositeLayout::fields(), MayaFlux::Kakshya::CompositeLayout::find_field(), index, MayaFlux::Journal::Kakshya, m_layout, MF_WARN, MayaFlux::Journal::Runtime, size(), and type.

Referenced by set_blob(), set_text(), and validate_dynamic_write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: