23 #include "openPMD/ChunkInfo.hpp"
24 #include "openPMD/Dataset.hpp"
25 #include "openPMD/IterationEncoding.hpp"
26 #include "openPMD/Streaming.hpp"
27 #include "openPMD/auxiliary/Export.hpp"
28 #include "openPMD/auxiliary/Memory.hpp"
29 #include "openPMD/auxiliary/Variant.hpp"
30 #include "openPMD/backend/Attribute.hpp"
31 #include "openPMD/backend/ParsePreference.hpp"
46 Writable *getWritable(Attributable *);
51 CREATE_FILE, CHECK_FILE, OPEN_FILE, CLOSE_FILE,
54 CREATE_PATH, CLOSE_PATH, OPEN_PATH, DELETE_PATH,
57 CREATE_DATASET, EXTEND_DATASET, OPEN_DATASET, DELETE_DATASET,
58 WRITE_DATASET, READ_DATASET, LIST_DATASETS, GET_BUFFER_VIEW,
60 DELETE_ATT, WRITE_ATT, READ_ATT, LIST_ATTS,
74 OPENPMDAPI_EXPORT std::string operationAsString(Operation);
82 virtual std::unique_ptr<AbstractParameter> to_heap() && = 0;
112 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_FILE>
121 std::unique_ptr<AbstractParameter> to_heap() &&
override
123 return std::unique_ptr<AbstractParameter>(
127 std::string name =
"";
131 struct OPENPMDAPI_EXPORT
Parameter<Operation::CHECK_FILE>
140 std::unique_ptr<AbstractParameter> to_heap() &&
override
142 return std::unique_ptr<AbstractParameter>(
146 std::string name =
"";
147 enum class FileExists
153 std::shared_ptr<FileExists> fileExists =
154 std::make_shared<FileExists>(FileExists::DontKnow);
158 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_FILE>
167 std::unique_ptr<AbstractParameter> to_heap() &&
override
169 return std::unique_ptr<AbstractParameter>(
173 std::string name =
"";
174 using ParsePreference = internal::ParsePreference;
175 std::shared_ptr<ParsePreference> out_parsePreference =
176 std::make_shared<ParsePreference>(ParsePreference::UpFront);
180 struct OPENPMDAPI_EXPORT
Parameter<Operation::CLOSE_FILE>
189 std::unique_ptr<AbstractParameter> to_heap() &&
override
191 return std::unique_ptr<AbstractParameter>(
197 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_FILE>
206 std::unique_ptr<AbstractParameter> to_heap() &&
override
208 return std::unique_ptr<AbstractParameter>(
212 std::string name =
"";
216 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_PATH>
225 std::unique_ptr<AbstractParameter> to_heap() &&
override
227 return std::unique_ptr<AbstractParameter>(
231 std::string path =
"";
235 struct OPENPMDAPI_EXPORT
Parameter<Operation::CLOSE_PATH>
244 std::unique_ptr<AbstractParameter> to_heap() &&
override
246 return std::unique_ptr<AbstractParameter>(
252 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_PATH>
261 std::unique_ptr<AbstractParameter> to_heap() &&
override
263 return std::unique_ptr<AbstractParameter>(
267 std::string path =
"";
271 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_PATH>
280 std::unique_ptr<AbstractParameter> to_heap() &&
override
282 return std::unique_ptr<AbstractParameter>(
286 std::string path =
"";
290 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_PATHS>
299 std::unique_ptr<AbstractParameter> to_heap() &&
override
301 return std::unique_ptr<AbstractParameter>(
305 std::shared_ptr<std::vector<std::string>> paths =
306 std::make_shared<std::vector<std::string>>();
310 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_DATASET>
319 std::unique_ptr<AbstractParameter> to_heap() &&
override
321 return std::unique_ptr<AbstractParameter>(
325 std::string name =
"";
327 Datatype dtype = Datatype::UNDEFINED;
328 std::string options =
"{}";
329 std::optional<size_t> joinedDimension;
337 template <
typename TracingJSON>
340 std::string
const ¤tBackendName,
341 std::string
const &warningMessage);
345 struct OPENPMDAPI_EXPORT
Parameter<Operation::EXTEND_DATASET>
354 std::unique_ptr<AbstractParameter> to_heap() &&
override
356 return std::unique_ptr<AbstractParameter>(
364 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_DATASET>
373 std::unique_ptr<AbstractParameter> to_heap() &&
override
375 return std::unique_ptr<AbstractParameter>(
379 std::string name =
"";
380 std::shared_ptr<Datatype> dtype = std::make_shared<Datatype>();
381 std::shared_ptr<Extent> extent = std::make_shared<Extent>();
385 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_DATASET>
394 std::unique_ptr<AbstractParameter> to_heap() &&
override
396 return std::unique_ptr<AbstractParameter>(
400 std::string name =
"";
404 struct OPENPMDAPI_EXPORT
Parameter<Operation::WRITE_DATASET>
414 std::unique_ptr<AbstractParameter> to_heap() &&
override
416 return std::unique_ptr<AbstractParameter>(
422 Datatype dtype = Datatype::UNDEFINED;
427 struct OPENPMDAPI_EXPORT
Parameter<Operation::READ_DATASET>
436 std::unique_ptr<AbstractParameter> to_heap() &&
override
438 return std::unique_ptr<AbstractParameter>(
444 Datatype dtype = Datatype::UNDEFINED;
445 std::shared_ptr<void> data =
nullptr;
449 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_DATASETS>
458 std::unique_ptr<AbstractParameter> to_heap() &&
override
460 return std::unique_ptr<AbstractParameter>(
464 std::shared_ptr<std::vector<std::string>> datasets =
465 std::make_shared<std::vector<std::string>>();
469 struct OPENPMDAPI_EXPORT
Parameter<Operation::GET_BUFFER_VIEW>
478 std::unique_ptr<AbstractParameter> to_heap() &&
override
480 return std::unique_ptr<AbstractParameter>(
487 Datatype dtype = Datatype::UNDEFINED;
492 bool backendManagedBuffer =
false;
493 unsigned viewIndex = 0;
496 std::shared_ptr<OutParameters> out = std::make_shared<OutParameters>();
500 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_ATT>
509 std::unique_ptr<AbstractParameter> to_heap() &&
override
511 return std::unique_ptr<AbstractParameter>(
515 std::string name =
"";
519 struct OPENPMDAPI_EXPORT
Parameter<Operation::WRITE_ATT>
528 std::unique_ptr<AbstractParameter> to_heap() &&
override
530 return std::unique_ptr<AbstractParameter>(
534 std::string name =
"";
535 Datatype dtype = Datatype::UNDEFINED;
542 enum class ChangesOverSteps
548 ChangesOverSteps changesOverSteps = ChangesOverSteps::No;
549 Attribute::resource resource;
562 std::unique_ptr<AbstractParameter> to_heap() &&
override
564 return std::unique_ptr<AbstractParameter>(
568 std::string name =
"";
569 std::shared_ptr<Datatype> dtype = std::make_shared<Datatype>();
570 std::shared_ptr<Attribute::resource> resource =
571 std::make_shared<Attribute::resource>();
575 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_ATTS>
584 std::unique_ptr<AbstractParameter> to_heap() &&
override
586 return std::unique_ptr<AbstractParameter>(
590 std::shared_ptr<std::vector<std::string>> attributes =
591 std::make_shared<std::vector<std::string>>();
604 std::unique_ptr<AbstractParameter> to_heap() &&
override
606 return std::unique_ptr<AbstractParameter>(
612 bool isThisStepMandatory =
false;
614 std::shared_ptr<AdvanceStatus> status =
619 struct OPENPMDAPI_EXPORT
Parameter<Operation::AVAILABLE_CHUNKS>
628 std::unique_ptr<AbstractParameter> to_heap() &&
override
630 return std::unique_ptr<AbstractParameter>(
635 std::shared_ptr<ChunkTable> chunks = std::make_shared<ChunkTable>();
639 struct OPENPMDAPI_EXPORT
Parameter<Operation::DEREGISTER>
642 Parameter(
void const *ptr_in) : former_parent(ptr_in)
651 std::unique_ptr<AbstractParameter> to_heap() &&
override
653 return std::make_unique<Parameter<Operation::DEREGISTER>>(
658 void const *former_parent =
nullptr;
680 template <Operation op>
682 : writable{w}, operation{op}, parameter{std::move(p).to_heap()}
685 template <Operation op>
687 : writable{getWritable(a)}
689 , parameter{std::move(p).to_heap()}
692 IOTask(IOTask
const &other);
693 IOTask(IOTask &&other) noexcept;
694 IOTask &operator=(IOTask
const &other);
695 IOTask &operator=(IOTask &&other) noexcept;
699 std::shared_ptr<AbstractParameter> parameter;
Layer to manage storage of attributes associated with file objects.
Definition: Attributable.hpp:101
Self-contained description of a single IO operation.
Definition: IOTask.hpp:670
IOTask(Writable *w, Parameter< op > p)
Constructor for self-contained description of single IO operation.
Definition: IOTask.hpp:681
Layer to mirror structure of logical data and persistent data in file.
Definition: Writable.hpp:75
Public definitions of openPMD-api.
Definition: Date.cpp:29
AdvanceMode
In step-based mode (i.e.
Definition: Streaming.hpp:35
Datatype
Concrete datatype of an object available at runtime.
Definition: Datatype.hpp:51
OPENPMDAPI_EXPORT_ENUM_CLASS(Operation)
Type of IO operation between logical and persistent data.
Definition: IOTask.hpp:50
Definition: IOTask.hpp:78
Definition: IOTask.hpp:597
AdvanceMode mode
input parameter
Definition: IOTask.hpp:611
Definition: IOTask.hpp:621
Definition: IOTask.hpp:133
Definition: IOTask.hpp:182
Definition: IOTask.hpp:237
Definition: IOTask.hpp:312
static void warnUnusedParameters(TracingJSON &, std::string const ¤tBackendName, std::string const &warningMessage)
Warn about unused JSON paramters.
Definition: IOTask.hpp:114
Definition: IOTask.hpp:218
Definition: IOTask.hpp:502
Definition: IOTask.hpp:387
Definition: IOTask.hpp:199
Definition: IOTask.hpp:273
Definition: IOTask.hpp:347
Definition: IOTask.hpp:471
Definition: IOTask.hpp:577
Definition: IOTask.hpp:451
Definition: IOTask.hpp:292
Definition: IOTask.hpp:366
Definition: IOTask.hpp:160
Definition: IOTask.hpp:254
Definition: IOTask.hpp:555
Definition: IOTask.hpp:429
Definition: IOTask.hpp:521
Definition: IOTask.hpp:406
Typesafe description of all required arguments for a specified Operation.
Definition: IOTask.hpp:105
Definition: Memory.hpp:175