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/Variant.hpp" 29 #include "openPMD/backend/Attribute.hpp" 39 class AttributableInterface;
42 Writable *getWritable(AttributableInterface *);
47 CREATE_FILE, OPEN_FILE, CLOSE_FILE, DELETE_FILE,
49 CREATE_PATH, CLOSE_PATH, OPEN_PATH, DELETE_PATH,
52 CREATE_DATASET, EXTEND_DATASET, OPEN_DATASET, DELETE_DATASET,
53 WRITE_DATASET, READ_DATASET, LIST_DATASETS, GET_BUFFER_VIEW,
55 DELETE_ATT, WRITE_ATT, READ_ATT, LIST_ATTS,
68 std::string operationAsString(Operation);
80 virtual std::unique_ptr<AbstractParameter> clone()
const = 0;
101 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_FILE>
109 std::unique_ptr<AbstractParameter> clone()
const override 111 return std::unique_ptr<AbstractParameter>(
115 std::string name =
"";
120 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_FILE>
128 std::unique_ptr<AbstractParameter> clone()
const override 130 return std::unique_ptr<AbstractParameter>(
134 std::string name =
"";
144 struct OPENPMDAPI_EXPORT
Parameter<Operation::CLOSE_FILE>
151 std::unique_ptr<AbstractParameter> clone()
const override 153 return std::unique_ptr<AbstractParameter>(
159 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_FILE>
166 std::unique_ptr<AbstractParameter> clone()
const override 168 return std::unique_ptr<AbstractParameter>(
172 std::string name =
"";
176 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_PATH>
183 std::unique_ptr<AbstractParameter> clone()
const override 185 return std::unique_ptr<AbstractParameter>(
189 std::string path =
"";
193 struct OPENPMDAPI_EXPORT
Parameter<Operation::CLOSE_PATH>
205 std::unique_ptr<AbstractParameter> clone()
const override 207 return std::unique_ptr<AbstractParameter>(
213 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_PATH>
220 std::unique_ptr<AbstractParameter> clone()
const override 222 return std::unique_ptr<AbstractParameter>(
226 std::string path =
"";
230 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_PATH>
237 std::unique_ptr<AbstractParameter> clone()
const override 239 return std::unique_ptr<AbstractParameter>(
243 std::string path =
"";
247 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_PATHS>
254 std::unique_ptr<AbstractParameter> clone()
const override 256 return std::unique_ptr<AbstractParameter>(
260 std::shared_ptr<std::vector<std::string> > paths =
261 std::make_shared<std::vector<std::string> >();
265 struct OPENPMDAPI_EXPORT
Parameter<Operation::CREATE_DATASET>
274 , chunkSize(p.chunkSize)
275 , compression(p.compression)
276 , transform(p.transform)
280 std::unique_ptr<AbstractParameter> clone()
const override 282 return std::unique_ptr<AbstractParameter>(
286 std::string name =
"";
288 Datatype dtype = Datatype::UNDEFINED;
289 Extent chunkSize = {};
290 std::string compression =
"";
291 std::string transform =
"";
292 std::string options =
"{}";
296 struct OPENPMDAPI_EXPORT
Parameter<Operation::EXTEND_DATASET>
303 std::unique_ptr<AbstractParameter> clone()
const override 305 return std::unique_ptr<AbstractParameter>(
313 struct OPENPMDAPI_EXPORT
Parameter<Operation::OPEN_DATASET>
321 std::unique_ptr<AbstractParameter> clone()
const override 323 return std::unique_ptr<AbstractParameter>(
327 std::string name =
"";
328 std::shared_ptr<Datatype> dtype = std::make_shared<Datatype>();
329 std::shared_ptr<Extent> extent = std::make_shared<Extent>();
333 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_DATASET>
340 std::unique_ptr<AbstractParameter> clone()
const override 342 return std::unique_ptr<AbstractParameter>(
346 std::string name =
"";
350 struct OPENPMDAPI_EXPORT
Parameter<Operation::WRITE_DATASET>
364 this->extent = p.extent;
365 this->offset = p.offset;
366 this->dtype = p.dtype;
371 std::unique_ptr<AbstractParameter> clone()
const override 373 return std::unique_ptr<AbstractParameter>(
379 Datatype dtype = Datatype::UNDEFINED;
380 std::shared_ptr<void const> data =
nullptr;
384 struct OPENPMDAPI_EXPORT
Parameter<Operation::READ_DATASET>
398 this->extent = p.extent;
399 this->offset = p.offset;
400 this->dtype = p.dtype;
405 std::unique_ptr<AbstractParameter> clone()
const override 407 return std::unique_ptr<AbstractParameter>(
413 Datatype dtype = Datatype::UNDEFINED;
414 std::shared_ptr<void> data =
nullptr;
418 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_DATASETS>
425 std::unique_ptr<AbstractParameter> clone()
const override 427 return std::unique_ptr<AbstractParameter>(
431 std::shared_ptr<std::vector<std::string> > datasets =
432 std::make_shared<std::vector<std::string> >();
436 struct OPENPMDAPI_EXPORT
Parameter<Operation::GET_BUFFER_VIEW>
449 std::unique_ptr<AbstractParameter> clone()
const override 451 return std::unique_ptr<AbstractParameter>(
458 Datatype dtype = Datatype::UNDEFINED;
463 bool backendManagedBuffer =
false;
464 unsigned viewIndex = 0;
467 std::shared_ptr<OutParameters> out = std::make_shared<OutParameters>();
471 struct OPENPMDAPI_EXPORT
Parameter<Operation::DELETE_ATT>
478 std::unique_ptr<AbstractParameter> clone()
const override 480 return std::unique_ptr<AbstractParameter>(
484 std::string name =
"";
488 struct OPENPMDAPI_EXPORT
Parameter<Operation::WRITE_ATT>
496 , resource(p.resource)
499 std::unique_ptr<AbstractParameter> clone()
const override 501 return std::unique_ptr<AbstractParameter>(
505 std::string name =
"";
506 Datatype dtype = Datatype::UNDEFINED;
507 Attribute::resource resource;
519 , resource(p.resource)
525 this->dtype = p.dtype;
526 this->resource = p.resource;
530 std::unique_ptr<AbstractParameter> clone()
const override 532 return std::unique_ptr<AbstractParameter>(
536 std::string name =
"";
537 std::shared_ptr<Datatype> dtype = std::make_shared<Datatype>();
538 std::shared_ptr<Attribute::resource> resource =
539 std::make_shared<Attribute::resource>();
543 struct OPENPMDAPI_EXPORT
Parameter<Operation::LIST_ATTS>
551 std::unique_ptr<AbstractParameter> clone()
const override 553 return std::unique_ptr<AbstractParameter>(
557 std::shared_ptr<std::vector<std::string> > attributes =
558 std::make_shared<std::vector<std::string> >();
570 std::unique_ptr<AbstractParameter> clone()
const override 572 return std::unique_ptr<AbstractParameter>(
579 std::shared_ptr<AdvanceStatus> status =
580 std::make_shared<AdvanceStatus>(AdvanceStatus::OK);
584 struct OPENPMDAPI_EXPORT
Parameter<Operation::AVAILABLE_CHUNKS>
597 std::unique_ptr<AbstractParameter> clone()
const override 599 return std::unique_ptr<AbstractParameter>(
604 std::shared_ptr<ChunkTable> chunks = std::make_shared<ChunkTable>();
626 template <Operation op>
628 : writable{w}, operation{op}, parameter{p.clone()}
631 template <Operation op>
633 : writable{getWritable(a)}, operation{op}, parameter{p.clone()}
637 : writable{other.writable}
638 , operation{other.operation}
639 , parameter{other.parameter}
644 writable = other.writable;
645 operation = other.operation;
646 parameter = other.parameter;
652 std::shared_ptr<AbstractParameter> parameter;
Definition: IOTask.hpp:562
Self-contained description of a single IO operation.
Definition: IOTask.hpp:615
Definition: IOTask.hpp:144
Definition: IOTask.hpp:230
Definition: IOTask.hpp:333
AdvanceMode mode
input parameter
Definition: IOTask.hpp:577
AdvanceMode
In step-based mode (i.e.
Definition: Streaming.hpp:33
Datatype
Concrete datatype of an object available at runtime.
Definition: Datatype.hpp:45
Definition: IOTask.hpp:120
Definition: IOTask.hpp:159
Definition: IOTask.hpp:471
Public definitions of openPMD-api.
Definition: Date.cpp:28
Layer to mirror structure of logical data and persistent data in file.
Definition: Writable.hpp:63
Definition: IOTask.hpp:193
Definition: IOTask.hpp:384
Typesafe description of all required arguments for a specified Operation.
Definition: IOTask.hpp:93
OPENPMDAPI_EXPORT_ENUM_CLASS(Operation)
Type of IO operation between logical and persistent data.
Definition: IOTask.hpp:46
Layer to manage storage of attributes associated with file objects.
Definition: Attributable.hpp:128
Definition: IOTask.hpp:543
Definition: IOTask.hpp:71
IterationEncoding
Encoding scheme of an Iterations Series'.
Definition: IterationEncoding.hpp:32
Definition: IOTask.hpp:101
Definition: IOTask.hpp:584
Definition: IOTask.hpp:418
Definition: IOTask.hpp:313
Definition: IOTask.hpp:176
Definition: IOTask.hpp:488
Definition: IOTask.hpp:265
Definition: IOTask.hpp:436
IOTask(Writable *w, Parameter< op > const &p)
Constructor for self-contained description of single IO operation.
Definition: IOTask.hpp:627
Definition: IOTask.hpp:511
Definition: IOTask.hpp:296
Definition: IOTask.hpp:213
Definition: IOTask.hpp:350
Definition: IOTask.hpp:247