|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
RAII guard that removes a temporary file unless committed. More...
#include <ca-checkpoint.H>
Public Member Functions | |
| Tmp_File_Guard (std::filesystem::path p) noexcept | |
| Tmp_File_Guard (const Tmp_File_Guard &)=delete | |
| Tmp_File_Guard & | operator= (const Tmp_File_Guard &)=delete |
| ~Tmp_File_Guard () noexcept | |
| void | commit () noexcept |
| Mark the temporary file as successfully renamed; suppress cleanup. | |
| const std::filesystem::path & | path () const noexcept |
| Access the underlying path. | |
Private Attributes | |
| std::filesystem::path | path_ |
| bool | committed_ = false |
RAII guard that removes a temporary file unless committed.
Used during atomic writes so a thrown exception (or early return) always cleans up the partial <path>.tmp.* sibling.
Definition at line 309 of file ca-checkpoint.H.
|
inlineexplicitnoexcept |
Definition at line 315 of file ca-checkpoint.H.
|
delete |
|
inlinenoexcept |
Definition at line 322 of file ca-checkpoint.H.
References Aleph::blossom_maximum_cardinality_matching(), committed_, and path_.
|
inlinenoexcept |
Mark the temporary file as successfully renamed; suppress cleanup.
Definition at line 332 of file ca-checkpoint.H.
References committed_.
Referenced by Aleph::CA::ca_checkpoint_detail::atomic_write_file().
|
delete |
|
inlinenoexcept |
Definition at line 312 of file ca-checkpoint.H.
Referenced by ~Tmp_File_Guard(), and commit().
|
private |
Definition at line 311 of file ca-checkpoint.H.
Referenced by ~Tmp_File_Guard(), and path().