Read a present arithmetic field by exact value type.
353{
355 if (!field_index || !
has(field_name))
356 return std::nullopt;
357
359 if (field.type == typeid(detail::CompositeDynamic)) {
360 if constexpr (std::same_as<T, int64_t> || std::same_as<T, double>) {
361 const auto dynamic =
value(field_name);
362 if (dynamic) {
363 if (const auto* typed = std::get_if<T>(&*dynamic))
364 return *typed;
365 }
366 }
367 return std::nullopt;
368 }
369 if (field.type != std::type_index(typeid(T)))
370 return std::nullopt;
371
372 const auto&
rows = std::get<std::vector<uint8_t>>(*m_rows);
374
377 sizeof(T));
378
380}
size_t stride_bytes() const noexcept
Bytes per packed element after finalization.
const std::vector< CompositeField > & fields() const noexcept
Declared fields in element order, with finalized byte offsets.
std::optional< size_t > find_field(std::string_view name) const noexcept
Find a field index by name, or std::nullopt if absent.
const CompositeLayout * m_layout
bool has(std::string_view field_name) const noexcept
Whether a named field exists and is present in this element.