OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::io::CheckpointFile Struct Reference

#include <CheckpointFile.hpp>

Collaboration diagram for openswmm::io::CheckpointFile:

Public Member Functions

std::string encode () const
 Serialize this companion's path, length and fingerprint contract.
 
void verify () const
 Check the named companion's exact size and fingerprint.
 

Static Public Member Functions

static CheckpointFile decode (std::string)
 Decode and validate a versioned companion-file contract.
 

Public Attributes

std::filesystem::path path
 
uint64_t bytes = 0
 
uint64_t fingerprint = 0
 

Detailed Description

Internal immutable output companion. Integrity detects accidental damage, not malicious edits. Physical/model archives remain independently validated.

Member Function Documentation

◆ decode()

CheckpointFile openswmm::io::CheckpointFile::decode ( std::string bytes)
static

Decode and validate a versioned companion-file contract.

Parameters
[in]bytesOwned binary archive, consumed by value; size must be less than 16384 bytes and the encoded UTF-8 path less than 8192 bytes.
Returns
Contract with a nonempty path and byte count in [1, INT64_MAX].
Exceptions
std::runtime_errorVersion, endian marker, field bounds or archive shape is invalid. Archive decoding exceptions may also propagate.
Note
This validates metadata only; call verify() to inspect file contents.
Here is the call graph for this function:

◆ encode()

std::string openswmm::io::CheckpointFile::encode ( ) const

Serialize this companion's path, length and fingerprint contract.

Returns
Newly owned binary archive containing version 1, endian marker, UTF-8 path, byte count and FNV-1a fingerprint; no file data is embedded.
Note
Does not validate the fields or read the companion file.
Here is the call graph for this function:

◆ verify()

void openswmm::io::CheckpointFile::verify ( ) const

Check the named companion's exact size and fingerprint.

Exceptions
std::runtime_errorThe path is not a non-symlink regular file, is unreadable, has changed length or has a different FNV-1a fingerprint. Filesystem inspection errors may also propagate.
Note
Uses a fixed 64 KiB read buffer. This detects accidental damage; it is not cryptographic authentication and does not lock the file.
Here is the call graph for this function:

Member Data Documentation

◆ bytes

uint64_t openswmm::io::CheckpointFile::bytes = 0

◆ fingerprint

uint64_t openswmm::io::CheckpointFile::fingerprint = 0

◆ path

std::filesystem::path openswmm::io::CheckpointFile::path

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