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

#include <CheckpointOutputPublication.hpp>

Collaboration diagram for openswmm::io::CheckpointOutputPublication:

Classes

struct  Output
 

Public Member Functions

 CheckpointOutputPublication (std::vector< Output >)
 Validate output pairs and reserve rollback headers before publication.
 
 ~CheckpointOutputPublication ()
 Remove reserved backup headers unless needed for failed rollback recovery.
 
 CheckpointOutputPublication (const CheckpointOutputPublication &)=delete
 
CheckpointOutputPublication & operator= (const CheckpointOutputPublication &)=delete
 
void publish ()
 Replace all validated fresh outputs, rolling back on a rename failure.
 

Constructor & Destructor Documentation

◆ CheckpointOutputPublication() [1/2]

openswmm::io::CheckpointOutputPublication::CheckpointOutputPublication ( std::vector< Output > outputs)
explicit

Validate output pairs and reserve rollback headers before publication.

Parameters
[in]outputsNonempty 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_errorValidation, 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.

Here is the caller graph for this function:

◆ ~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]

openswmm::io::CheckpointOutputPublication::CheckpointOutputPublication ( const CheckpointOutputPublication & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ operator=()

CheckpointOutputPublication & openswmm::io::CheckpointOutputPublication::operator= ( const CheckpointOutputPublication & )
delete
Here is the call graph for this function:

◆ publish()

void openswmm::io::CheckpointOutputPublication::publish ( )

Replace all validated fresh outputs, rolling back on a rename failure.

Exceptions
std::runtime_errorA 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: