23 #include "openPMD/IO/Access.hpp"
24 #include "openPMD/IO/Format.hpp"
25 #include "openPMD/IO/IOTask.hpp"
26 #include "openPMD/IterationEncoding.hpp"
27 #include "openPMD/config.hpp"
38 #include <type_traits>
88 std::string backendConfig =
"{}";
95 : flushLevel(flushLevel_in)
96 , backendConfig{std::move(backendConfig_in)}
105 struct ParsedFlushParams;
130 template <
typename Functor,
typename... Args>
131 auto withRWAccess(
SeriesStatus &status, Functor &&functor, Args &&...args)
132 -> decltype(std::forward<Functor>(functor)(std::forward<Args>(args)...))
134 using Res = decltype(std::forward<Functor>(functor)(
135 std::forward<Args>(args)...));
136 if constexpr (std::is_void_v<Res>)
138 auto oldStatus = status;
142 std::forward<decltype(functor)>(functor)();
154 auto oldStatus = status;
159 res = std::forward<decltype(functor)>(functor)();
200 if (encoding == IterationEncoding::fileBased &&
207 m_encoding = encoding;
213 : directory{std::move(path)}, m_backendAccess{at}, m_frontendAccess{at}
217 : directory{std::move(path)}, m_backendAccess{at}, m_frontendAccess{at}
254 std::string directory;
273 std::queue<IOTask> m_work;
Definition: ADIOS2IOHandler.hpp:94
Interface for communicating between logical and physically persistent data.
Definition: AbstractIOHandler.hpp:186
virtual std::future< void > flush(internal::ParsedFlushParams &)=0
Process operations in queue according to FIFO.
std::future< void > flush(internal::FlushParams const &)
Process operations in queue according to FIFO.
Definition: AbstractIOHandler.cpp:28
bool m_lastFlushSuccessful
This is to avoid that the destructor tries flushing again if an error happened.
Definition: AbstractIOHandler.hpp:281
virtual std::string backendName() const =0
The currently used backend.
virtual void enqueue(IOTask const &iotask)
Add provided task to queue according to FIFO.
Definition: AbstractIOHandler.hpp:232
Self-contained description of a single IO operation.
Definition: IOTask.hpp:670
Implementation for the root level of the openPMD hierarchy.
Definition: Series.hpp:219
Definition: ADIOS2File.hpp:137
SeriesStatus
Some parts of the openPMD object model are read-only when accessing a Series in Access::READ_ONLY mod...
Definition: AbstractIOHandler.hpp:119
@ Default
Mutability of objects in the openPMD object model is determined by the open mode (Access enum),...
@ Parsing
All objects in the openPMD object model are temporarily mutable to allow inserting newly-parsed data.
Public definitions of openPMD-api.
Definition: Date.cpp:29
Access
File access mode to use during IO.
Definition: Access.hpp:30
@ CREATE
create new series and truncate existing (files)
@ APPEND
write new iterations to an existing series without reading
FlushLevel
Determine what items should be flushed upon Series::flush()
Definition: AbstractIOHandler.hpp:49
@ SkeletonOnly
Restricted mode, ensures to set up the openPMD hierarchy (as far as defined so far) in the backend.
@ CreateOrOpenFiles
Only creates/opens files, nothing more.
@ InternalFlush
Default mode, used when flushes are triggered internally, e.g.
@ UserFlush
Flush operation that was triggered by user code.
IterationEncoding
Encoding scheme of an Iterations Series'.
Definition: IterationEncoding.hpp:33
Parameters recursively passed through the openPMD hierarchy when flushing.
Definition: AbstractIOHandler.hpp:86
Definition: FlushParametersInternal.hpp:32