Read a present arithmetic or GLM field by exact value type.
467{
468 const auto field_index =
m_layout->find_field(field_name);
469 if (!field_index || !
has(field_name))
470 return std::nullopt;
471
472 const auto& field =
m_layout->fields()[*field_index];
473 if (field.type == typeid(detail::CompositeDynamic)) {
474 if constexpr (std::same_as<T, int64_t> || std::same_as<T, double>) {
475 const auto dynamic =
value(field_name);
476 if (dynamic) {
477 if (const auto* typed = std::get_if<T>(&*dynamic))
478 return *typed;
479 }
480 }
481 return std::nullopt;
482 }
483 if (field.type != std::type_index(typeid(T)))
484 return std::nullopt;
485
486 const auto& rows = std::get<std::vector<uint8_t>>(*m_rows);
488
491 sizeof(T));
492
494}
std::optional< CompositeValue > value(std::string_view field_name) const noexcept
Borrow a dynamic value; an absent field returns std::nullopt.
const CompositeLayout * m_layout
bool has(std::string_view field_name) const noexcept
Whether a named field exists and is present in this element.