23 #include "openPMD/auxiliary/Export.hpp"
24 #include "openPMD/auxiliary/Variant.hpp"
25 #include "openPMD/backend/Attribute.hpp"
26 #include "openPMD/ChunkInfo.hpp"
27 #include "openPMD/Dataset.hpp"
28 #include "openPMD/IterationEncoding.hpp"
29 #include "openPMD/Streaming.hpp"
40 class AttributableInterface;
44 getWritable(AttributableInterface*);
88 virtual std::unique_ptr< AbstractParameter > clone()
const = 0;
114 std::unique_ptr< AbstractParameter >
115 clone()
const override
117 return std::unique_ptr< AbstractParameter >(
121 std::string name =
"";
132 std::unique_ptr< AbstractParameter >
133 clone()
const override
135 return std::unique_ptr< AbstractParameter >(
139 std::string name =
"";
154 std::unique_ptr< AbstractParameter >
155 clone()
const override
157 return std::unique_ptr< AbstractParameter >(
168 std::unique_ptr< AbstractParameter >
169 clone()
const override
171 return std::unique_ptr< AbstractParameter >(
175 std::string name =
"";
184 std::unique_ptr< AbstractParameter >
185 clone()
const override
187 return std::unique_ptr< AbstractParameter >(
191 std::string path =
"";
208 std::unique_ptr< AbstractParameter >
209 clone()
const override
211 return std::unique_ptr< AbstractParameter >(
222 std::unique_ptr< AbstractParameter >
223 clone()
const override
225 return std::unique_ptr< AbstractParameter >(
229 std::string path =
"";
238 std::unique_ptr< AbstractParameter >
239 clone()
const override
241 return std::unique_ptr< AbstractParameter >(
245 std::string path =
"";
254 std::unique_ptr< AbstractParameter >
255 clone()
const override
257 return std::unique_ptr< AbstractParameter >(
261 std::shared_ptr< std::vector< std::string > > paths
262 = std::make_shared< std::vector< std::string > >();
270 name(p.name), extent(p.extent), dtype(p.dtype),
271 chunkSize(p.chunkSize), compression(p.compression),
272 transform(p.transform), options(p.options) {}
274 std::unique_ptr< AbstractParameter >
275 clone()
const override
277 return std::unique_ptr< AbstractParameter >(
281 std::string name =
"";
283 Datatype dtype = Datatype::UNDEFINED;
284 Extent chunkSize = {};
285 std::string compression =
"";
286 std::string transform =
"";
287 std::string options =
"{}";
296 std::unique_ptr< AbstractParameter >
297 clone()
const override
299 return std::unique_ptr< AbstractParameter >(
311 name(p.name), dtype(p.dtype), extent(p.extent) {}
313 std::unique_ptr< AbstractParameter >
314 clone()
const override
316 return std::unique_ptr< AbstractParameter >(
320 std::string name =
"";
321 std::shared_ptr< Datatype > dtype
322 = std::make_shared< Datatype >();
323 std::shared_ptr< Extent > extent
324 = std::make_shared< Extent >();
333 std::unique_ptr< AbstractParameter >
334 clone()
const override
336 return std::unique_ptr< AbstractParameter >(
340 std::string name =
"";
348 extent(p.extent), offset(p.offset), dtype(p.dtype),
352 this->extent = p.extent;
353 this->offset = p.offset;
354 this->dtype = p.dtype;
359 std::unique_ptr< AbstractParameter >
360 clone()
const override
362 return std::unique_ptr< AbstractParameter >(
368 Datatype dtype = Datatype::UNDEFINED;
369 std::shared_ptr< void const > data =
nullptr;
377 extent(p.extent), offset(p.offset), dtype(p.dtype),
381 this->extent = p.extent;
382 this->offset = p.offset;
383 this->dtype = p.dtype;
388 std::unique_ptr< AbstractParameter >
389 clone()
const override
391 return std::unique_ptr< AbstractParameter >(
397 Datatype dtype = Datatype::UNDEFINED;
398 std::shared_ptr< void > data =
nullptr;
406 datasets(p.datasets) {}
408 std::unique_ptr< AbstractParameter >
409 clone()
const override
411 return std::unique_ptr< AbstractParameter >(
415 std::shared_ptr< std::vector< std::string > > datasets
416 = std::make_shared< std::vector< std::string > >();
424 offset(p.offset), extent(p.extent), dtype(p.dtype), update(p.update),
428 std::unique_ptr< AbstractParameter >
429 clone()
const override
431 return std::unique_ptr< AbstractParameter >(
438 Datatype dtype = Datatype::UNDEFINED;
443 bool backendManagedBuffer =
false;
444 unsigned viewIndex = 0;
447 std::shared_ptr< OutParameters > out = std::make_shared< OutParameters >();
456 std::unique_ptr< AbstractParameter >
457 clone()
const override
459 return std::unique_ptr< AbstractParameter >(
463 std::string name =
"";
471 name(p.name), dtype(p.dtype), resource(p.resource) {}
473 std::unique_ptr< AbstractParameter >
474 clone()
const override
476 return std::unique_ptr< AbstractParameter >(
480 std::string name =
"";
481 Datatype dtype = Datatype::UNDEFINED;
482 Attribute::resource resource;
490 name(p.name), dtype(p.dtype), resource(p.resource) {}
494 this->dtype = p.dtype;
495 this->resource = p.resource;
499 std::unique_ptr< AbstractParameter >
500 clone()
const override
502 return std::unique_ptr< AbstractParameter >(
506 std::string name =
"";
507 std::shared_ptr< Datatype > dtype
508 = std::make_shared< Datatype >();
509 std::shared_ptr< Attribute::resource > resource
510 = std::make_shared< Attribute::resource >();
518 attributes(p.attributes) {}
520 std::unique_ptr< AbstractParameter >
521 clone()
const override
523 return std::unique_ptr< AbstractParameter >(
527 std::shared_ptr< std::vector< std::string > > attributes
528 = std::make_shared< std::vector< std::string > >();
540 std::unique_ptr< AbstractParameter >
541 clone()
const override
543 return std::unique_ptr< AbstractParameter >(
550 std::shared_ptr< AdvanceStatus > status =
551 std::make_shared< AdvanceStatus >( AdvanceStatus::OK );
555 struct OPENPMDAPI_EXPORT
Parameter< Operation::AVAILABLE_CHUNKS >
570 std::unique_ptr< AbstractParameter >
571 clone()
const override
573 return std::unique_ptr< AbstractParameter >(
578 std::shared_ptr< ChunkTable > chunks = std::make_shared< ChunkTable >();
598 template< Operation op >
606 template< Operation op >
607 explicit IOTask(AttributableInterface* a,
608 Parameter< op >
const & p)
609 : writable{getWritable(a)},
614 explicit IOTask(IOTask
const & other) :
615 writable{other.writable},
616 operation{other.operation},
617 parameter{other.parameter}
620 IOTask& operator=(IOTask
const & other)
622 writable = other.writable;
623 operation = other.operation;
624 parameter = other.parameter;
630 std::shared_ptr< AbstractParameter > parameter;