23 #include "openPMD/auxiliary/Variant.hpp" 24 #include "openPMD/backend/Attribute.hpp" 25 #include "openPMD/Dataset.hpp" 34 # define EXPORT __declspec( dllexport ) 35 #elif defined(__NVCC__) 38 # define EXPORT __attribute__((visibility("default"))) 48 getWritable(Attributable*);
52 #if defined(__GNUC__) && (__GNUC__ < 6) && !defined(__clang__) 54 enum class Operation : EXPORT unsigned int
91 virtual std::unique_ptr< AbstractParameter > clone()
const = 0;
102 template< Operation >
116 std::unique_ptr< AbstractParameter >
117 clone()
const override 119 return std::unique_ptr< AbstractParameter >(
123 std::string name =
"";
132 std::unique_ptr< AbstractParameter >
133 clone()
const override 135 return std::unique_ptr< AbstractParameter >(
139 std::string name =
"";
148 std::unique_ptr< AbstractParameter >
149 clone()
const override 151 return std::unique_ptr< AbstractParameter >(
155 std::string name =
"";
164 std::unique_ptr< AbstractParameter >
165 clone()
const override 167 return std::unique_ptr< AbstractParameter >(
171 std::string path =
"";
180 std::unique_ptr< AbstractParameter >
181 clone()
const override 183 return std::unique_ptr< AbstractParameter >(
187 std::string path =
"";
196 std::unique_ptr< AbstractParameter >
197 clone()
const override 199 return std::unique_ptr< AbstractParameter >(
203 std::string path =
"";
212 std::unique_ptr< AbstractParameter >
213 clone()
const override 215 return std::unique_ptr< AbstractParameter >(
219 std::shared_ptr< std::vector< std::string > > paths
220 = std::make_shared< std::vector< std::string > >();
228 name(p.name), extent(p.extent), dtype(p.dtype),
229 chunkSize(p.chunkSize), compression(p.compression),
230 transform(p.transform) {}
232 std::unique_ptr< AbstractParameter >
233 clone()
const override 235 return std::unique_ptr< AbstractParameter >(
239 std::string name =
"";
241 Datatype dtype = Datatype::UNDEFINED;
242 Extent chunkSize = {};
243 std::string compression =
"";
244 std::string transform =
"";
252 name(p.name), extent(p.extent) {}
254 std::unique_ptr< AbstractParameter >
255 clone()
const override 257 return std::unique_ptr< AbstractParameter >(
261 std::string name =
"";
270 name(p.name), dtype(p.dtype), extent(p.extent) {}
272 std::unique_ptr< AbstractParameter >
273 clone()
const override 275 return std::unique_ptr< AbstractParameter >(
279 std::string name =
"";
280 std::shared_ptr< Datatype > dtype
281 = std::make_shared< Datatype >();
282 std::shared_ptr< Extent > extent
283 = std::make_shared< Extent >();
292 std::unique_ptr< AbstractParameter >
293 clone()
const override 295 return std::unique_ptr< AbstractParameter >(
299 std::string name =
"";
307 extent(p.extent), offset(p.offset), dtype(p.dtype),
311 this->extent = p.extent;
312 this->offset = p.offset;
313 this->dtype = p.dtype;
318 std::unique_ptr< AbstractParameter >
319 clone()
const override 321 return std::unique_ptr< AbstractParameter >(
327 Datatype dtype = Datatype::UNDEFINED;
328 std::shared_ptr< void const > data =
nullptr;
336 extent(p.extent), offset(p.offset), dtype(p.dtype),
340 this->extent = p.extent;
341 this->offset = p.offset;
342 this->dtype = p.dtype;
347 std::unique_ptr< AbstractParameter >
348 clone()
const override 350 return std::unique_ptr< AbstractParameter >(
356 Datatype dtype = Datatype::UNDEFINED;
357 std::shared_ptr< void > data =
nullptr;
365 datasets(p.datasets) {}
367 std::unique_ptr< AbstractParameter >
368 clone()
const override 370 return std::unique_ptr< AbstractParameter >(
374 std::shared_ptr< std::vector< std::string > > datasets
375 = std::make_shared< std::vector< std::string > >();
384 std::unique_ptr< AbstractParameter >
385 clone()
const override 387 return std::unique_ptr< AbstractParameter >(
391 std::string name =
"";
399 name(p.name), dtype(p.dtype), resource(p.resource) {}
401 std::unique_ptr< AbstractParameter >
402 clone()
const override 404 return std::unique_ptr< AbstractParameter >(
408 std::string name =
"";
409 Datatype dtype = Datatype::UNDEFINED;
410 Attribute::resource resource;
418 name(p.name), dtype(p.dtype), resource(p.resource) {}
422 this->dtype = p.dtype;
423 this->resource = p.resource;
427 std::unique_ptr< AbstractParameter >
428 clone()
const override 430 return std::unique_ptr< AbstractParameter >(
434 std::string name =
"";
435 std::shared_ptr< Datatype > dtype
436 = std::make_shared< Datatype >();
437 std::shared_ptr< Attribute::resource > resource
438 = std::make_shared< Attribute::resource >();
446 attributes(p.attributes) {}
448 std::unique_ptr< AbstractParameter >
449 clone()
const override 451 return std::unique_ptr< AbstractParameter >(
455 std::shared_ptr< std::vector< std::string > > attributes
456 = std::make_shared< std::vector< std::string > >();
477 template< Operation op >
485 template< Operation op >
488 : writable{getWritable(a)},
494 writable{other.writable},
495 operation{other.operation},
496 parameter{other.parameter}
501 writable = other.writable;
502 operation = other.operation;
503 parameter = other.parameter;
509 std::shared_ptr< AbstractParameter > parameter;
Self-contained description of a single IO operation.
Definition: IOTask.hpp:468
Definition: IOTask.hpp:191
Definition: IOTask.hpp:287
Datatype
Concrete datatype of an object available at runtime.
Definition: Datatype.hpp:38
Definition: IOTask.hpp:127
Definition: IOTask.hpp:143
Definition: IOTask.hpp:379
Public definitions of openPMD-api.
Definition: Date.cpp:28
Layer to mirror structure of logical data and persistent data in file.
Definition: Writable.hpp:55
Definition: IOTask.hpp:332
Typesafe description of all required arguments for a specified Operation.
Definition: IOTask.hpp:103
Definition: IOTask.hpp:442
Definition: IOTask.hpp:82
Definition: IOTask.hpp:111
Definition: IOTask.hpp:361
Definition: IOTask.hpp:266
Definition: IOTask.hpp:159
Definition: IOTask.hpp:395
Definition: IOTask.hpp:224
Operation
Type of IO operation between logical and persistent data.
Definition: IOTask.hpp:56
IOTask(Writable *w, Parameter< op > const &p)
Constructor for self-contained description of single IO operation.
Definition: IOTask.hpp:478
Definition: IOTask.hpp:414
Definition: IOTask.hpp:248
Definition: IOTask.hpp:175
Definition: IOTask.hpp:303
Definition: IOTask.hpp:207
Layer to manage storage of attributes associated with file objects.
Definition: Attributable.hpp:65