openPMD-api
 
Loading...
Searching...
No Matches
openPMD::InvalidatableFile Struct Reference

Wrapper around a shared pointer to: More...

#include <InvalidatableFile.hpp>

Classes

struct  FileState
 

Public Member Functions

 InvalidatableFile (std::string s)
 
void invalidate ()
 
bool valid () const
 
InvalidatableFileoperator= (std::string s)
 
bool operator== (InvalidatableFile const &f) const
 
std::string & operator* () const
 
std::string * operator-> () const
 
 operator bool () const
 

Public Attributes

std::shared_ptr< FileStatefileState
 

Detailed Description

Wrapper around a shared pointer to:

  • a filename
  • and a boolean indicating whether the file still exists The wrapper adds no extra information, but some commodity functions. Invariant for any context within which this class shall be used: For any valid filename, there is at any time at most one such shared pointer (wrapper) known in said context's data structures (counting by pointer equality) This means, that a file can be invalidated (i.e. deleted or overwritten) by simply searching for one instance of the file among all known files and invalidating this instance A new instance may hence only be created after making sure that there are no valid instances in the data structures.

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