SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::utils::serialize::Reader Class Reference

Inspect the ledger first, then seek directly to whichever components are actually needed. More...

#include <archive.hpp>

Collaboration diagram for serif::utils::serialize::Reader:
[legend]

Public Member Functions

const std::vector< Entry > & ledger () const noexcept
 Inspect all available components, including unsupported or incomplete descriptions.
 
const std::string & serif_version () const noexcept
 Read the SERiF version reported by the writer.
 
Format format () const noexcept
 Inspect the on-disk numeric encoding.
 
bool contains (std::string_view path) const
 Check whether a named component or field is present without decoding it.
 
Result< Node > node (std::string_view path) const
 Read a subtree, verifying each selected payload before returning owned data.
 
Result< Node > metadata () const
 Read timestamp, host information, library versions, and user annotations.
 
template<typename T>
Result< T > read (std::string_view path={}) const
 Decode a component using its registered default name, or an explicit archive path.
 
Result< void > validate () const
 Check every payload, useful before transferring responsibility for an archive to another researcher.
 

Static Public Member Functions

static Result< Reader > open (const std::filesystem::path &path, ReadOptions options={})
 Validate the header, compatibility policy, and index without reading coefficient payloads.
 

Private Attributes

std::ifstream m_file
 
std::vector< Entry > m_entries
 
std::string m_version
 
Format m_format {Format::binary}
 
ReadOptions m_options
 

Detailed Description

Inspect the ledger first, then seek directly to whichever components are actually needed.

Member Function Documentation

◆ contains()

bool serif::utils::serialize::Reader::contains ( std::string_view path) const
nodiscard

Check whether a named component or field is present without decoding it.

◆ format()

Format serif::utils::serialize::Reader::format ( ) const
inlinenodiscardnoexcept

Inspect the on-disk numeric encoding.

◆ ledger()

const std::vector< Entry > & serif::utils::serialize::Reader::ledger ( ) const
inlinenodiscardnoexcept

Inspect all available components, including unsupported or incomplete descriptions.

◆ metadata()

Result< Node > serif::utils::serialize::Reader::metadata ( ) const
inlinenodiscard

Read timestamp, host information, library versions, and user annotations.

◆ node()

Result< Node > serif::utils::serialize::Reader::node ( std::string_view path) const
nodiscard

Read a subtree, verifying each selected payload before returning owned data.

◆ open()

Result< Reader > serif::utils::serialize::Reader::open ( const std::filesystem::path & path,
ReadOptions options = {} )
staticnodiscard

Validate the header, compatibility policy, and index without reading coefficient payloads.

◆ read()

template<typename T>
Result< T > serif::utils::serialize::Reader::read ( std::string_view path = {}) const
inlinenodiscard

Decode a component using its registered default name, or an explicit archive path.

◆ serif_version()

const std::string & serif::utils::serialize::Reader::serif_version ( ) const
inlinenodiscardnoexcept

Read the SERiF version reported by the writer.

◆ validate()

Result< void > serif::utils::serialize::Reader::validate ( ) const
nodiscard

Check every payload, useful before transferring responsibility for an archive to another researcher.

Member Data Documentation

◆ m_entries

std::vector<Entry> serif::utils::serialize::Reader::m_entries
private

◆ m_file

std::ifstream serif::utils::serialize::Reader::m_file
mutableprivate

◆ m_format

Format serif::utils::serialize::Reader::m_format {Format::binary}
private

◆ m_options

ReadOptions serif::utils::serialize::Reader::m_options
private

◆ m_version

std::string serif::utils::serialize::Reader::m_version
private

The documentation for this class was generated from the following files: