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"
28#include "openPMD/version.hpp"
84enum class OpenpmdStandard
94 auto parseStandard(std::string
const &) -> OpenpmdStandard;
95 auto formatStandard(OpenpmdStandard) ->
char const *;
108 std::string backendConfig =
"{}";
110 explicit FlushParams()
112 FlushParams(
FlushLevel flushLevel_in) : flushLevel(flushLevel_in)
114 FlushParams(
FlushLevel flushLevel_in, std::string backendConfig_in)
115 : flushLevel(flushLevel_in)
116 , backendConfig{std::move(backendConfig_in)}
125 struct ParsedFlushParams;
138 enum class SeriesStatus :
unsigned char
150 template <
typename Functor,
typename... Args>
151 auto withRWAccess(SeriesStatus &status, Functor &&functor, Args &&...args)
152 ->
decltype(std::forward<Functor>(functor)(std::forward<Args>(args)...))
154 using Res =
decltype(std::forward<Functor>(functor)(
155 std::forward<Args>(args)...));
156 if constexpr (std::is_void_v<Res>)
158 auto oldStatus = status;
159 status = internal::SeriesStatus::Parsing;
162 std::forward<decltype(functor)>(functor)();
174 auto oldStatus = status;
175 status = internal::SeriesStatus::Parsing;
179 res = std::forward<decltype(functor)>(functor)();
205class AbstractIOHandler
208 friend class ADIOS2IOHandlerImpl;
209 friend class JSONIOHandlerImpl;
210 friend class HDF5IOHandlerImpl;
220 std::unique_ptr<json::JsonMatcher> jsonMatcher;
224 template <
typename TracingJSON>
226 std::optional<std::unique_ptr<AbstractIOHandler>> initialize_from,
229 TracingJSON &&jsonConfig,
233 template <
typename TracingJSON>
235 std::optional<std::unique_ptr<AbstractIOHandler>> initialize_from,
238 TracingJSON &&jsonConfig);
240 AbstractIOHandler(std::optional<std::unique_ptr<AbstractIOHandler>>);
242 virtual ~AbstractIOHandler();
244 AbstractIOHandler(AbstractIOHandler
const &) =
delete;
247 AbstractIOHandler(AbstractIOHandler &&)
noexcept(
false);
249 AbstractIOHandler &operator=(AbstractIOHandler
const &) =
delete;
250 AbstractIOHandler &operator=(AbstractIOHandler &&)
noexcept;
278 virtual bool fullSupportForVariableBasedEncoding()
const;
280 std::string directory;
298 std::queue<IOTask> m_work;
314 internal::SeriesStatus m_seriesStatus = internal::SeriesStatus::Default;
317 bool m_verify_homogeneous_extents =
true;
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:106
bool m_lastFlushSuccessful
This is to avoid that the destructor tries flushing again if an error happened.
Definition AbstractIOHandler.hpp:313
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:257
Self-contained description of a single IO operation.
Definition IOTask.hpp:836
Definition ADIOS2File.hpp:143
Class to handle default and dataset-specific JSON configurations.
Definition JSONMatcher.hpp:89
Public definitions of openPMD-api.
Definition Date.cpp:29
Access
File access mode to use during IO.
Definition Access.hpp:58
FlushLevel
Determine what items should be flushed upon Series::flush()
Definition AbstractIOHandler.hpp:55
@ SkeletonOnly
Restricted mode, ensures to set up the openPMD hierarchy (as far as defined so far) in the backend.
Definition AbstractIOHandler.hpp:77
@ CreateOrOpenFiles
Only creates/opens files, nothing more.
Definition AbstractIOHandler.hpp:81
@ InternalFlush
Default mode, used when flushes are triggered internally, e.g.
Definition AbstractIOHandler.hpp:69
@ UserFlush
Flush operation that was triggered by user code.
Definition AbstractIOHandler.hpp:61
IterationEncoding
Encoding scheme of an Iterations Series'.
Definition IterationEncoding.hpp:33
std::string getStandardDefault()
Return the default used version of the openPMD standard (read & write, run-time)
Definition version.cpp:41
Parameters recursively passed through the openPMD hierarchy when flushing.
Definition AbstractIOHandler.hpp:106
Definition FlushParametersInternal.hpp:32