NDEVR
API Documentation
TemporaryIOFileLocker

Manages temporary file paths during an IOFactory write operation, ensuring safe writes by writing to temporary files first and then moving them to the final destination. More...

Collaboration diagram for TemporaryIOFileLocker:
[legend]

Public Member Functions

 TemporaryIOFileLocker (FactoryParameters &params)
 Constructs the locker, replacing file paths in params with temporary paths.
 ~TemporaryIOFileLocker ()
 Destructor.
Buffer< std::pair< File, File > > writeToActual ()
 Moves all temporary files to their actual (final) destinations.

Protected Attributes

Dictionary< String, FileRequestm_original_requests
 The original file requests before temporary path substitution.
FactoryParametersm_params
 Reference to the FactoryParameters being managed.

Detailed Description

Manages temporary file paths during an IOFactory write operation, ensuring safe writes by writing to temporary files first and then moving them to the final destination.


When constructed, the locker replaces the file paths in the FactoryParameters with temporary paths. On writeToActual(), the temporary files are moved to their intended locations. The destructor cleans up any remaining temporary files if writeToActual() was not called.

Definition at line 206 of file IOFactory.h.

Constructor & Destructor Documentation

◆ TemporaryIOFileLocker()

TemporaryIOFileLocker::TemporaryIOFileLocker ( FactoryParameters & params)

Constructs the locker, replacing file paths in params with temporary paths.


Parameters
[in]paramsThe FactoryParameters whose file paths will be redirected to temporary files.

◆ ~TemporaryIOFileLocker()

TemporaryIOFileLocker::~TemporaryIOFileLocker ( )

Destructor.


Cleans up temporary files and restores original file paths in the parameters.

Member Function Documentation

◆ writeToActual()

Buffer< std::pair< File, File > > TemporaryIOFileLocker::writeToActual ( )

Moves all temporary files to their actual (final) destinations.


Returns
A buffer of pairs mapping each temporary file path to its actual destination path.

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