openPMD-api
Public Member Functions | Public Attributes | Friends | List of all members
openPMD::Writable Class Referencefinal

Layer to mirror structure of logical data and persistent data in file. More...

#include <Writable.hpp>

Collaboration diagram for openPMD::Writable:
Collaboration graph
[legend]

Public Member Functions

 Writable (Writable const &other)=delete
 
 Writable (Writable &&other)=delete
 
Writableoperator= (Writable const &other)=delete
 
Writableoperator= (Writable &&other)=delete
 
void seriesFlush (std::string backendConfig="{}")
 Flush the corresponding Series object. More...
 
private void seriesFlush (internal::FlushParams const &)
 

Public Attributes

std::shared_ptr< AbstractFilePositionabstractFilePosition = nullptr
 
std::shared_ptr< std::optional< std::unique_ptr< AbstractIOHandler > > > IOHandler = nullptr
 
internal::AttributableDataattributable = nullptr
 
Writableparent = nullptr
 
bool dirtySelf = true
 Tracks if there are unwritten changes for this specific Writable. More...
 
bool dirtyRecursive = true
 Tracks if there are unwritten changes anywhere in the tree whose ancestor this Writable is. More...
 
std::string ownKeyWithinParent
 If parent is not null, then this is a key such that: &(*parent)[key] == this.
 
bool written = false
 Whether a Writable has been written to the backend. More...
 

Friends

class internal::AttributableData
 
class internal::SeriesData
 
class Attributable
 
template<typename T_elem >
class BaseRecord
 
template<typename T_elem >
class BaseRecordInterface
 
template<typename T , typename T_key , typename T_container >
class Container
 
class Iteration
 
class Mesh
 
class ParticleSpecies
 
class Series
 
class Record
 
class AbstractIOHandlerImpl
 
class ADIOS2IOHandlerImpl
 
class detail::ADIOS2File
 
class HDF5IOHandlerImpl
 
class ParallelHDF5IOHandlerImpl
 
template<typename >
class AbstractIOHandlerImplCommon
 
class JSONIOHandlerImpl
 
struct test::TestHelper
 
template<typename >
class Span
 
std::string concrete_h5_file_position (Writable *)
 
std::string concrete_bp1_file_position (Writable *)
 
void debug::printDirty (Series const &)
 

Detailed Description

Layer to mirror structure of logical data and persistent data in file.

Hierarchy of objects (datasets, groups, attributes, ...) in openPMD is managed in this class. It also indicates the current synchronization state between logical and persistent data: - whether the object has been created in persistent form

Member Function Documentation

◆ seriesFlush()

void openPMD::Writable::seriesFlush ( std::string  backendConfig = "{}")

Flush the corresponding Series object.

Writable connects all objects of an openPMD series through a linked list of parents. This method will walk up the parent list until it reaches an object that has no parent, which is the Series object, and flush()-es it.

Member Data Documentation

◆ dirtyRecursive

bool openPMD::Writable::dirtyRecursive = true

Tracks if there are unwritten changes anywhere in the tree whose ancestor this Writable is.

Invariant: this->dirtyRecursive implies parent->dirtyRecursive.

dirtySelf and dirtyRecursive are separated since that allows specifying that this is not dirty, but some child is.

Manipulate via Attributable::dirtyRecursive() and Attributable::setDirtyRecursive().

◆ dirtySelf

bool openPMD::Writable::dirtySelf = true

Tracks if there are unwritten changes for this specific Writable.

Manipulate via Attributable::dirty() and Attributable::setDirty().

◆ written

bool openPMD::Writable::written = false

Whether a Writable has been written to the backend.

The class Writable is used to link objects in our (frontend) object model of the openPMD group hierarchy to the backends. The openPMD hierarchy needs to be built by each backend independently from the frontend. This involves the following tasks:

  • Opening/creating files/groups/datasets
  • Setting up the path structure in Writable::abstractFilePosition

If those tasks have been performed, the flag written is set as true. The interpretation of that is that the backend has been made aware of the Writable and its meaning within the current dataset.


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