SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
record.hpp File Reference
#include <algorithm>
#include <array>
#include <bit>
#include <concepts>
#include <cstdint>
#include <exception>
#include <expected>
#include <functional>
#include <limits>
#include <map>
#include <optional>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <utility>
#include <variant>
#include <vector>
Include dependency graph for record.hpp:
This graph shows which files directly or indirectly include this file:

Classes

struct  serif::utils::serialize::Error
 Identify the component or field that could not be saved or reconstructed. More...
 
struct  serif::utils::serialize::Node
 A named component owns its fields, stable schema identifier, and schema version. More...
 
struct  serif::utils::serialize::Field
 Associate a field name with an already encoded child. More...
 
struct  serif::utils::serialize::Member< T >
 Name a typed field expected by a component's loader. More...
 
struct  serif::utils::serialize::Serializer< Node >
 Preserve a raw component when inspection, rather than typed reconstruction, is wanted. More...
 
struct  serif::utils::serialize::Serializer< T >
 Store numeric values using explicit portable widths. More...
 
struct  serif::utils::serialize::Serializer< std::string >
 
struct  serif::utils::serialize::Serializer< std::string_view >
 
struct  serif::utils::serialize::Serializer< char[Size]>
 
struct  serif::utils::serialize::Serializer< std::vector< T > >
 Arrays of coefficients are contiguous payloads, while compound values retain named children. More...
 
struct  serif::utils::serialize::Serializer< std::array< T, Size > >
 
struct  serif::utils::serialize::Serializer< std::optional< T > >
 
struct  serif::utils::serialize::Serializer< std::tuple< T... > >
 

Namespaces

namespace  serif
 
namespace  serif::utils
 
namespace  serif::utils::serialize
 

Typedefs

template<typename T>
using serif::utils::serialize::Result = std::expected<T, Error>
 
using serif::utils::serialize::Value
 Portable scientific data; runtime pointers and computational caches have no representation here.
 

Functions

template<typename T>
Node serif::utils::serialize::encode (const T &value)
 Produce data when a serializer exists, otherwise record the missing capability explicitly.
 
template<typename T>
Result< T > serif::utils::serialize::decode (const Node &node)
 Translate invalid saved parameters into a value error at the reconstruction boundary.
 
template<typename T>
Field serif::utils::serialize::field (std::string name, const T &value)
 Encode one named field of a component.
 
template<typename... Fields>
Node serif::utils::serialize::object (std::string_view type, Fields... fields)
 Compose a component from its independently serialized fields.
 
template<typename T>
Member< T > serif::utils::serialize::member (std::string_view name)
 Describe one field to read_object without a separate temporary variable.
 
template<typename T>
Result< T > serif::utils::serialize::read_field (const Node &node, std::string_view name)
 Read a required field and retain its full path in any diagnostic.
 
template<typename Construct, typename... Members>
auto serif::utils::serialize::read_object (const Node &node, std::string_view type, Construct construct, Members... members) -> Result< std::invoke_result_t< Construct, typename Members::Type... > >
 Construct a component only after every required field has decoded successfully.
 
std::string serif::utils::serialize::fingerprint (std::string_view bytes)
 Versioned content identity for accidental corruption and resource matching; not a cryptographic signature.