NGen
Loading...
Searching...
No Matches
ngen::serialization::RecordBackend::Reader Class Referenceabstract

A read handle for one restore session. More...

#include <record_backend.hpp>

+ Inheritance diagram for ngen::serialization::RecordBackend::Reader:
+ Collaboration diagram for ngen::serialization::RecordBackend::Reader:

Public Member Functions

virtual ~Reader ()=default
 
virtual auto find_latest (const std::string &id) -> expected< Record, BackendError >=0
 Return the latest record for id within this Reader's scope.
 
virtual auto find_at_step (const std::string &id, int64_t time_step) -> expected< Record, BackendError >=0
 Return the record for id at the given simulation step.
 
virtual auto find_at_simulation_timestamp (const std::string &id, int64_t simulation_timestamp) -> expected< Record, BackendError >=0
 Return the record for id at the given simulation timestamp (seconds since Unix epoch).
 
virtual auto close () -> expected< void, BackendError >
 Optional explicit close.
 

Detailed Description

A read handle for one restore session.

Scoped at construction by an IdPredicate. Obtained only via RecordBackend::reader(); cannot be constructed standalone or mixed across backends. "Not found" is returned on the expected<> error arm as BackendError::Kind::NotFound.

Constructor & Destructor Documentation

◆ ~Reader()

virtual ngen::serialization::RecordBackend::Reader::~Reader ( )
virtualdefault

Member Function Documentation

◆ close()

virtual auto ngen::serialization::RecordBackend::Reader::close ( ) -> expected<void, BackendError>
inlinenodiscardvirtual

Optional explicit close.

Default is a no-op success; backends with fallible read-side teardown override to surface those errors. After a successful close(), subsequent find_* calls have undefined behavior. with_reader calls this automatically on success.

◆ find_at_simulation_timestamp()

virtual auto ngen::serialization::RecordBackend::Reader::find_at_simulation_timestamp ( const std::string & id,
int64_t simulation_timestamp ) -> expected< Record, BackendError >
nodiscardpure virtual

Return the record for id at the given simulation timestamp (seconds since Unix epoch).

Multiple records with the same (id, simulation_timestamp) resolve to the latest checkpoint_epoch.

Implemented in ngen::serialization::FileBackend::Reader.

◆ find_at_step()

virtual auto ngen::serialization::RecordBackend::Reader::find_at_step ( const std::string & id,
int64_t time_step ) -> expected< Record, BackendError >
nodiscardpure virtual

Return the record for id at the given simulation step.

Multiple records with the same (id, time_step) resolve to the latest checkpoint_epoch.

Implemented in ngen::serialization::FileBackend::Reader.

◆ find_latest()

virtual auto ngen::serialization::RecordBackend::Reader::find_latest ( const std::string & id) -> expected< Record, BackendError >
nodiscardpure virtual

Return the latest record for id within this Reader's scope.

Ordering: highest time_step first, ties broken by highest checkpoint_epoch (latest write wins).

Implemented in ngen::serialization::FileBackend::Reader.


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