|
NGen
|
Namespaces | |
| namespace | anonymous_namespace{file_backend.cpp} |
| namespace | detail |
| One checkpoint record: a saved-state blob tagged with its feature id, simulation step counter, the simulated moment the state represents, and the wall-clock moment the operator triggered the save. | |
Classes | |
| struct | BackendError |
Categorized error carried on every abstract-backend method's expected<> error arm. More... | |
| class | FileBackend |
| class | RecordBackend |
Abstract storage interface for Records. More... | |
Typedefs | |
| using | IdPredicate = std::function<bool(const std::string& id)> |
| Eligibility predicate over a SerializationRecord's id string. | |
| using | Record = detail::RecordT<std::vector<char>> |
| A checkpoint record that owns its payload. | |
| using | RecordView = detail::RecordT<boost::span<const char>> |
| A checkpoint record that views its payload (non-owning). | |
Enumerations | |
| enum class | Durability { relaxed , strict } |
| Save-time durability requirement. More... | |
Functions | |
| IdPredicate | exact_id (std::string target) |
Match: the id equals target exactly. | |
| IdPredicate | primary_prefix (std::string prefix) |
Match: the first :/. | |
| IdPredicate | contains_segment (std::string segment) |
Match: segment appears as any :/. | |
| IdPredicate | at_position (std::size_t n, std::string value) |
Match: the n'th (zero-indexed) :/. | |
| IdPredicate | starts_with (std::string prefix) |
Match: the id begins with the substring prefix. | |
| IdPredicate | all_of (std::vector< IdPredicate > preds) |
| All sub-predicates must be true. | |
| IdPredicate | any_of (std::vector< IdPredicate > preds) |
| Any sub-predicate true. | |
| IdPredicate | not_fn (IdPredicate p) |
Inverse of p. | |
| int64_t | parse_epoch_string (const std::string &s) |
Parse s as a whole-string signed integer interpreted as Unix epoch seconds (e.g. | |
| int64_t | parse_formatted_time (const std::string &s) |
Parse s as a formatted timestamp matching TIMESTAMP_STRPTIME_FORMAT. | |
| int64_t | parse_timestamp (const std::string &s) |
Parse s as seconds-since-Unix-epoch. | |
Variables | |
| constexpr const char * | TIMESTAMP_STRPTIME_FORMAT = "%Y-%m-%d %T" |
Tests in parse_timestamp_Test.cpp pin both TIMESTAMP_STRPTIME_FORMAT and UNPARSEABLE_TIMESTAMP_SENTINEL so producer/consumer drift surfaces as a test failure. | |
| constexpr int64_t | UNPARSEABLE_TIMESTAMP_SENTINEL = (std::numeric_limits<int64_t>::min)() |
Out-of-band value returned by parse_timestamp and its helpers when the input string cannot be resolved to a Unix epoch. | |
| constexpr int | LIBRARY_VERSION_MAJOR = 0 |
| constexpr int | LIBRARY_VERSION_MINOR = 1 |
| constexpr int | LIBRARY_VERSION_PATCH = 0 |
| constexpr const char * | LIBRARY_VERSION_STRING = "0.1.0" |
| Human-readable "MAJOR.MINOR.PATCH" string. | |
| using ngen::serialization::IdPredicate = std::function<bool(const std::string& id)> |
Eligibility predicate over a SerializationRecord's id string.
The library invokes this once per record during the index walk and treats the returned bool as authoritative.
| using ngen::serialization::Record = detail::RecordT<std::vector<char>> |
A checkpoint record that owns its payload.
payload is a std::vector<char> of opaque saved bytes — neither this value type nor any consumer interprets them; the producer chooses the byte format and the eventual consumer parses them.
See RecordView for the non-owning payload-view.
| using ngen::serialization::RecordView = detail::RecordT<boost::span<const char>> |
A checkpoint record that views its payload (non-owning).
Same metadata field set as Record, but payload is a boost::span<const char> rather than an owning vector. The caller keeps the payload bytes alive elsewhere for the lifetime of the view.
|
strong |
|
inline |
All sub-predicates must be true.
Short-circuits on the first false.
|
inline |
Any sub-predicate true.
Short-circuits on the first true.
|
inline |
Match: the n'th (zero-indexed) :/.
-delimited segment of the id equals value. Returns false if the id has fewer than n + 1 segments.
|
inline |
Match: segment appears as any :/.
-delimited token in the id. Exact-token match — "key_1" does not match "key_10".
|
inline |
Match: the id equals target exactly.
The default common case for restore-by-known-id.
Referenced by models::bmi::protocols::NgenDeserializationProtocol::run().
|
inline |
Inverse of p.
Named after std::not_fn from <functional>.
|
inline |
Parse s as a whole-string signed integer interpreted as Unix epoch seconds (e.g.
"1448931600", "-3786825600", " 42 "). Leading/trailing whitespace is stripped before conversion. Any other form is considered unparseable.
Returns UNPARSEABLE_TIMESTAMP_SENTINEL on any failure (partial match, empty, whitespace-only, non-numeric, integer overflow). Never throws.
References UNPARSEABLE_TIMESTAMP_SENTINEL.
Referenced by parse_timestamp().
|
inline |
Parse s as a formatted timestamp matching TIMESTAMP_STRPTIME_FORMAT.
Interpreted in UTC via timegm. White space is allowed and doesn't impact the match.
Returns UNPARSEABLE_TIMESTAMP_SENTINEL on any failure (empty, whitespace-only, partial match, trailing non-whitespace).
References TIMESTAMP_STRPTIME_FORMAT, and UNPARSEABLE_TIMESTAMP_SENTINEL.
Referenced by parse_timestamp().
|
inline |
Parse s as seconds-since-Unix-epoch.
Tries parse_epoch_string first, then attempts parse_formatted_time (TIMESTAMP_STRPTIME_FORMAT match). Returns UNPARSEABLE_TIMESTAMP_SENTINEL only when neither parser can resolve the input.
References parse_epoch_string(), parse_formatted_time(), and UNPARSEABLE_TIMESTAMP_SENTINEL.
|
inline |
Match: the first :/.
-delimited segment of the id equals prefix. Encodes the ngen v0.2 composition convention where "cat-1" matches both "cat-1:cfe" and "cat-1.0:cfe:multi".
Referenced by models::bmi::protocols::anonymous_namespace{deserialization.cpp}::make_scope().
|
inline |
Match: the id begins with the substring prefix.
Escape hatch for ids that are not segment-structured.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Human-readable "MAJOR.MINOR.PATCH" string.
|
constexpr |
Tests in parse_timestamp_Test.cpp pin both TIMESTAMP_STRPTIME_FORMAT and UNPARSEABLE_TIMESTAMP_SENTINEL so producer/consumer drift surfaces as a test failure.
strptime format used by parse_timestamp's formatted- string fallback.
Referenced by parse_formatted_time().
|
constexpr |
Out-of-band value returned by parse_timestamp and its helpers when the input string cannot be resolved to a Unix epoch.
INT64_MIN interpreted as Unix epoch is roughly 9.2e18 seconds before 1970 — far enough before any plausible simulated moment
Referenced by models::bmi::protocols::NgenDeserializationProtocol::initialize(), parse_epoch_string(), parse_formatted_time(), parse_timestamp(), and models::bmi::protocols::NgenSerializationProtocol::run().