#include <CheckpointOutputPublication.hpp>
◆ CheckpointOutputPublication() [1/2]
| openswmm::io::CheckpointOutputPublication::CheckpointOutputPublication |
( |
std::vector< Output > | outputs | ) |
|
|
explicit |
Validate output pairs and reserve rollback headers before publication.
- Parameters
-
| [in] | outputs | Nonempty vector of staging/destination pairs, consumed by value. Each staging path is an existing regular file; each destination must still be its writable fresh_header bytes. All paths must be distinct and non-aliasing. original_descriptor, when >= 0, is borrowed for identity checks. |
- Exceptions
-
| std::runtime_error | Validation, alias checks or backup reservation fails. Filesystem and allocation exceptions may propagate. Reserved backups are removed if construction fails. |
Reserves hard-linked rollback headers and copies destination permissions to staging files. It neither closes writer handles nor takes responsibility for removing staging files.
◆ ~CheckpointOutputPublication()
| openswmm::io::CheckpointOutputPublication::~CheckpointOutputPublication |
( |
| ) |
|
Remove reserved backup headers unless needed for failed rollback recovery.
- Note
- Cleanup errors are ignored. Staging files and published destinations remain caller-managed.
◆ CheckpointOutputPublication() [2/2]
◆ operator=()
◆ publish()
| void openswmm::io::CheckpointOutputPublication::publish |
( |
| ) |
|
Replace all validated fresh outputs, rolling back on a rename failure.
- Exceptions
-
| std::runtime_error | A destination changed, publication fails or rollback fails. Recovery backup paths are included in the latter diagnostic. Filesystem exceptions can propagate from preflight identity checks. |
Revalidates each destination immediately before the rename sequence. Writers remain on their old handles. This sequence is not an atomic view for external readers and provides no power-loss transaction guarantee. A failed rollback retains its backup header for manual recovery.
- Precondition
- Call at most once after successful construction and do not concurrently modify any staging, destination or reserved backup path.
The documentation for this class was generated from the following files: