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 *);
91 OPENPMDAPI_EXPORT std::string operationAsString(Operation);
99 virtual std::unique_ptr<AbstractParameter> to_heap() && = 0;
129 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_FILE>
138 std::unique_ptr<AbstractParameter> to_heap() &&
override
140 return std::unique_ptr<AbstractParameter>(
144 std::string name =
"";
148 struct OPENPMDAPI_EXPORT
Parameter<Operation::CHECK_FILE>
157 std::unique_ptr<AbstractParameter> to_heap() &&
override
159 return std::unique_ptr<AbstractParameter>(
163 std::string name =
"";
164 enum class FileExists
170 std::shared_ptr<FileExists> fileExists =
171 std::make_shared<FileExists>(FileExists::DontKnow);
175 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_FILE>
184 std::unique_ptr<AbstractParameter> to_heap() &&
override
186 return std::unique_ptr<AbstractParameter>(
190 std::string name =
"";
191 using ParsePreference = internal::ParsePreference;
192 std::shared_ptr<ParsePreference> out_parsePreference =
193 std::make_shared<ParsePreference>(ParsePreference::UpFront);
197 struct OPENPMDAPI_EXPORT
Parameter<Operation::CLOSE_FILE>
206 std::unique_ptr<AbstractParameter> to_heap() &&
override
208 return std::unique_ptr<AbstractParameter>(
214 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_FILE>
223 std::unique_ptr<AbstractParameter> to_heap() &&
override
225 return std::unique_ptr<AbstractParameter>(
229 std::string name =
"";
233 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_PATH>
242 std::unique_ptr<AbstractParameter> to_heap() &&
override
244 return std::unique_ptr<AbstractParameter>(
248 std::string path =
"";
252 struct OPENPMDAPI_EXPORT
Parameter<Operation::CLOSE_PATH>
261 std::unique_ptr<AbstractParameter> to_heap() &&
override
263 return std::unique_ptr<AbstractParameter>(
269 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_PATH>
278 std::unique_ptr<AbstractParameter> to_heap() &&
override
280 return std::unique_ptr<AbstractParameter>(
284 std::string path =
"";
288 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_PATH>
297 std::unique_ptr<AbstractParameter> to_heap() &&
override
299 return std::unique_ptr<AbstractParameter>(
303 std::string path =
"";
307 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_PATHS>
316 std::unique_ptr<AbstractParameter> to_heap() &&
override
318 return std::unique_ptr<AbstractParameter>(
322 std::shared_ptr<std::vector<std::string>> paths =
323 std::make_shared<std::vector<std::string>>();
327 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_DATASET>
336 std::unique_ptr<AbstractParameter> to_heap() &&
override
338 return std::unique_ptr<AbstractParameter>(
342 std::string name =
"";
344 Datatype dtype = Datatype::UNDEFINED;
345 std::string options =
"{}";
346 std::optional<size_t> joinedDimension;
354 template <
typename TracingJSON>
357 std::string
const ¤tBackendName,
358 std::string
const &warningMessage);
362 struct OPENPMDAPI_EXPORT
Parameter<Operation::EXTEND_DATASET>
371 std::unique_ptr<AbstractParameter> to_heap() &&
override
373 return std::unique_ptr<AbstractParameter>(
381 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_DATASET>
390 std::unique_ptr<AbstractParameter> to_heap() &&
override
392 return std::unique_ptr<AbstractParameter>(
396 std::string name =
"";
397 std::shared_ptr<Datatype> dtype = std::make_shared<Datatype>();
398 std::shared_ptr<Extent> extent = std::make_shared<Extent>();
402 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_DATASET>
411 std::unique_ptr<AbstractParameter> to_heap() &&
override
413 return std::unique_ptr<AbstractParameter>(
417 std::string name =
"";
421 struct OPENPMDAPI_EXPORT
Parameter<Operation::WRITE_DATASET>
431 std::unique_ptr<AbstractParameter> to_heap() &&
override
433 return std::unique_ptr<AbstractParameter>(
439 Datatype dtype = Datatype::UNDEFINED;
444 struct OPENPMDAPI_EXPORT
Parameter<Operation::READ_DATASET>
453 std::unique_ptr<AbstractParameter> to_heap() &&
override
455 return std::unique_ptr<AbstractParameter>(
461 Datatype dtype = Datatype::UNDEFINED;
462 std::shared_ptr<void> data =
nullptr;
466 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_DATASETS>
475 std::unique_ptr<AbstractParameter> to_heap() &&
override
477 return std::unique_ptr<AbstractParameter>(
481 std::shared_ptr<std::vector<std::string>> datasets =
482 std::make_shared<std::vector<std::string>>();
486 struct OPENPMDAPI_EXPORT
Parameter<Operation::GET_BUFFER_VIEW>
495 std::unique_ptr<AbstractParameter> to_heap() &&
override
497 return std::unique_ptr<AbstractParameter>(
504 Datatype dtype = Datatype::UNDEFINED;
509 bool backendManagedBuffer =
false;
510 unsigned viewIndex = 0;
513 std::shared_ptr<OutParameters> out = std::make_shared<OutParameters>();
517 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_ATT>
526 std::unique_ptr<AbstractParameter> to_heap() &&
override
528 return std::unique_ptr<AbstractParameter>(
532 std::string name =
"";
536 struct OPENPMDAPI_EXPORT
Parameter<Operation::WRITE_ATT>
545 std::unique_ptr<AbstractParameter> to_heap() &&
override
547 return std::unique_ptr<AbstractParameter>(
551 std::string name =
"";
552 Datatype dtype = Datatype::UNDEFINED;
559 enum class ChangesOverSteps
565 ChangesOverSteps changesOverSteps = ChangesOverSteps::No;
566 Attribute::resource resource;
579 std::unique_ptr<AbstractParameter> to_heap() &&
override
581 return std::unique_ptr<AbstractParameter>(
585 std::string name =
"";
586 std::shared_ptr<Datatype> dtype = std::make_shared<Datatype>();
587 std::shared_ptr<Attribute::resource> resource =
588 std::make_shared<Attribute::resource>();
592 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_ATTS>
601 std::unique_ptr<AbstractParameter> to_heap() &&
override
603 return std::unique_ptr<AbstractParameter>(
607 std::shared_ptr<std::vector<std::string>> attributes =
608 std::make_shared<std::vector<std::string>>();
621 std::unique_ptr<AbstractParameter> to_heap() &&
override
623 return std::unique_ptr<AbstractParameter>(
629 bool isThisStepMandatory =
false;
631 std::shared_ptr<AdvanceStatus> status =
636 struct OPENPMDAPI_EXPORT
Parameter<Operation::AVAILABLE_CHUNKS>
645 std::unique_ptr<AbstractParameter> to_heap() &&
override
647 return std::unique_ptr<AbstractParameter>(
652 std::shared_ptr<ChunkTable> chunks = std::make_shared<ChunkTable>();
656 struct OPENPMDAPI_EXPORT
Parameter<Operation::DEREGISTER>
659 Parameter(
void const *ptr_in) : former_parent(ptr_in)
668 std::unique_ptr<AbstractParameter> to_heap() &&
override
670 return std::make_unique<Parameter<Operation::DEREGISTER>>(
675 void const *former_parent =
nullptr;
689 std::unique_ptr<AbstractParameter> to_heap() &&
override
691 return std::make_unique<Parameter<Operation::TOUCH>>(std::move(*
this));
696 struct OPENPMDAPI_EXPORT
Parameter<Operation::SET_WRITTEN>
707 std::unique_ptr<AbstractParameter> to_heap() &&
override
709 return std::make_unique<Parameter<Operation::SET_WRITTEN>>(
713 bool target_status =
false;
735 template <Operation op>
737 : writable{w}, operation{op}, parameter{std::move(p).to_heap()}
740 template <Operation op>
742 : writable{getWritable(a)}
744 , parameter{std::move(p).to_heap()}
747 IOTask(IOTask
const &other);
748 IOTask(IOTask &&other) noexcept;
749 IOTask &operator=(IOTask
const &other);
750 IOTask &operator=(IOTask &&other) noexcept;
754 std::shared_ptr<AbstractParameter> parameter;
Layer to manage storage of attributes associated with file objects.
Definition: Attributable.hpp:155
Self-contained description of a single IO operation.
Definition: IOTask.hpp:725
IOTask(Writable *w, Parameter< op > p)
Constructor for self-contained description of single IO operation.
Definition: IOTask.hpp:736
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:95
Definition: IOTask.hpp:614
AdvanceMode mode
input parameter
Definition: IOTask.hpp:628
Definition: IOTask.hpp:638
Definition: IOTask.hpp:150
Definition: IOTask.hpp:199
Definition: IOTask.hpp:254
Definition: IOTask.hpp:329
static void warnUnusedParameters(TracingJSON &, std::string const ¤tBackendName, std::string const &warningMessage)
Warn about unused JSON paramters.
Definition: IOTask.hpp:131
Definition: IOTask.hpp:235
Definition: IOTask.hpp:519
Definition: IOTask.hpp:404
Definition: IOTask.hpp:216
Definition: IOTask.hpp:290
Definition: IOTask.hpp:364
Definition: IOTask.hpp:488
Definition: IOTask.hpp:594
Definition: IOTask.hpp:468
Definition: IOTask.hpp:309
Definition: IOTask.hpp:383
Definition: IOTask.hpp:177
Definition: IOTask.hpp:271
Definition: IOTask.hpp:572
Definition: IOTask.hpp:446
Definition: IOTask.hpp:538
Definition: IOTask.hpp:423
Typesafe description of all required arguments for a specified Operation.
Definition: IOTask.hpp:122
Definition: Memory.hpp:175