openPMD-api
Public Member Functions | Friends | List of all members
openPMD::PatchRecordComponent Class Reference

#include <PatchRecordComponent.hpp>

Inheritance diagram for openPMD::PatchRecordComponent:
Inheritance graph
[legend]
Collaboration diagram for openPMD::PatchRecordComponent:
Collaboration graph
[legend]

Public Member Functions

 PatchRecordComponent (BaseRecord< PatchRecordComponent > const &)
 Avoid object slicing when using a Record as a scalar Record Component. More...
 
PatchRecordComponentsetUnitSI (double)
 
PatchRecordComponentresetDataset (Dataset) override
 Declare the dataset's type and extent. More...
 
uint8_t getDimensionality () const
 
Extent getExtent () const
 
template<typename T >
std::shared_ptr< T > load ()
 
template<typename T >
void load (std::shared_ptr< T >)
 
template<typename T >
void load (std::shared_ptr< T[]>)
 
template<typename T >
void loadRaw (T *)
 
template<typename T >
void store (uint64_t idx, T)
 
template<typename T >
void store (T)
 
 PatchRecordComponent (NoInit)
 
void flush (std::string const &, internal::FlushParams const &)
 
- Public Member Functions inherited from openPMD::RecordComponent
 RecordComponent (BaseRecord< RecordComponent > const &)
 Avoid object slicing when using a Record as a scalar Record Component. More...
 
RecordComponentsetUnitSI (double)
 
uint8_t getDimensionality () const
 
Extent getExtent () const
 
template<typename T >
RecordComponentmakeConstant (T)
 Create a dataset with regular extent and constant value. More...
 
template<typename T >
RecordComponentmakeEmpty (uint8_t dimensions)
 Create a dataset with zero extent in each dimension. More...
 
RecordComponentmakeEmpty (Datatype dt, uint8_t dimensions)
 Non-template overload of RecordComponent::makeEmpty(). More...
 
bool empty () const
 Returns true if this is an empty record component. More...
 
template<typename T >
std::shared_ptr< T > loadChunk (Offset={0u}, Extent={-1u})
 Load and allocate a chunk of data. More...
 
shared_ptr_dataset_types loadChunkVariant (Offset={0u}, Extent={-1u})
 std::variant-based version of allocating loadChunk<T>(Offset, Extent) More...
 
template<typename T >
void loadChunk (std::shared_ptr< T > data, Offset offset, Extent extent)
 Load a chunk of data into pre-allocated memory. More...
 
template<typename T >
void loadChunk (std::shared_ptr< T[]> data, Offset offset, Extent extent)
 Load a chunk of data into pre-allocated memory, array version. More...
 
template<typename T >
void loadChunkRaw (T *data, Offset offset, Extent extent)
 Load a chunk of data into pre-allocated memory, raw pointer version. More...
 
template<typename T >
void storeChunk (std::shared_ptr< T > data, Offset offset, Extent extent)
 Store a chunk of data from a chunk of memory. More...
 
template<typename T >
void storeChunk (std::shared_ptr< T[]> data, Offset offset, Extent extent)
 Store a chunk of data from a chunk of memory, array version. More...
 
template<typename T >
void storeChunk (UniquePtrWithLambda< T > data, Offset offset, Extent extent)
 Store a chunk of data from a chunk of memory, unique pointer version. More...
 
template<typename T , typename Del >
void storeChunk (std::unique_ptr< T, Del > data, Offset offset, Extent extent)
 Store a chunk of data from a chunk of memory, unique pointer version. More...
 
template<typename T >
void storeChunkRaw (T *data, Offset offset, Extent extent)
 Store a chunk of data from a chunk of memory, raw pointer version. More...
 
template<typename T_ContiguousContainer >
std::enable_if_t< auxiliary::IsContiguousContainer_v< T_ContiguousContainer > > storeChunk (T_ContiguousContainer &data, Offset offset={0u}, Extent extent={-1u})
 Store a chunk of data from a contiguous container. More...
 
template<typename T , typename F >
DynamicMemoryView< T > storeChunk (Offset offset, Extent extent, F &&createBuffer)
 Overload of storeChunk() that lets the openPMD API allocate a buffer. More...
 
template<typename T >
DynamicMemoryView< T > storeChunk (Offset, Extent)
 Overload of span-based storeChunk() that uses operator new() to create a buffer.
 
template<typename Visitor , typename... Args>
auto visit (Args &&...args) -> decltype(Visitor::template call< char >(std::declval< RecordComponent & >(), std::forward< Args >(args)...))
 Run a template functor on the type of the record component, similar to std::visit(). More...
 
- Public Member Functions inherited from openPMD::BaseRecordComponent
 BaseRecordComponent (BaseRecordComponent const &other)
 
 BaseRecordComponent (BaseRecordComponent &&other)
 
BaseRecordComponentoperator= (BaseRecordComponent const &other)
 
BaseRecordComponentoperator= (BaseRecordComponent &&other)
 
double unitSI () const
 
BaseRecordComponentresetDatatype (Datatype)
 
Datatype getDatatype () const
 
bool constant () const
 Returns true if this is a constant record component. More...
 
std::optional< size_t > joinedDimension () const
 
ChunkTable availableChunks ()
 Get data chunks that are available to be loaded from the backend. More...
 
- Public Member Functions inherited from openPMD::Attributable
 Attributable (NoInit)
 
Attribute getAttribute (std::string const &key) const
 Retrieve value of Attribute stored with provided key. More...
 
bool deleteAttribute (std::string const &key)
 Remove Attribute of provided value both logically and physically. More...
 
std::vector< std::string > attributes () const
 List all currently stored Attributes' keys. More...
 
size_t numAttributes () const
 Count all currently stored Attributes. More...
 
bool containsAttribute (std::string const &key) const
 Check whether am Attribute with a given key exists. More...
 
std::string comment () const
 Retrieve a user-supplied comment associated with the object. More...
 
AttributablesetComment (std::string const &comment)
 Populate Attribute corresponding to a comment with the user-supplied comment. More...
 
void seriesFlush (std::string backendConfig="{}")
 Flush the corresponding Series object. More...
 
MyPath myPath () const
 The path to this object within its containing Series. More...
 
protected Series retrieveSeries () const
 
void seriesFlush (internal::FlushParams const &)
 
void flushAttributes (internal::FlushParams const &)
 
void readAttributes (ReadMode)
 
template<typename T >
readFloatingpoint (std::string const &key) const
 Retrieve the value of a floating point Attribute of user-defined precision with ensured type-safety. More...
 
template<typename T >
std::vector< T > readVectorFloatingpoint (std::string const &key) const
 Retrieve a vector of values of a floating point Attributes of user-defined precision with ensured type-safety. More...
 
AbstractIOHandlerIOHandler ()
 
AbstractIOHandler const * IOHandler () const
 
Writable *& parent ()
 
Writable const * parent () const
 
Writablewritable ()
 
Writable const & writable () const
 
void setData (std::shared_ptr< internal::AttributableData > attri)
 
internal::AttributableDataget ()
 
internal::AttributableData const & get () const
 
bool dirty () const
 
bool dirtyRecursive () const
 O(1).
 
void setDirty (bool dirty_in)
 
void setDirtyRecursive (bool dirty_in)
 
bool written () const
 
bool & written ()
 
template<typename T >
bool setAttribute (std::string const &key, T value)
 Populate Attribute of provided name with provided value. More...
 
bool setAttribute (std::string const &key, char const value[])
 
Iteration const & containingIteration () const
 Returns the corresponding Iteration. More...
 
IterationcontainingIteration ()
 

Friends

template<typename T , typename T_key , typename T_container >
class Container
 
template<typename >
class BaseRecord
 
template<typename , typename >
class internal::BaseRecordData
 
class ParticlePatches
 
class PatchRecord
 
class ParticleSpecies
 

Additional Inherited Members

- Public Types inherited from openPMD::RecordComponent
enum class  Allocation { USER , API , AUTO }
 
using shared_ptr_dataset_types = auxiliary::detail::map_variant< auxiliary::detail::as_shared_pointer, dataset_types >::type
 
- Public Types inherited from openPMD::Attributable
enum  ReadMode { IgnoreExisting , OverrideExisting , FullyReread }
 
- Static Public Attributes inherited from openPMD::RecordComponent
static constexpr char const *const SCALAR = "\vScalar"
 
- Protected Types inherited from openPMD::BaseRecordComponent
using Data_t = internal::BaseRecordComponentData
 
- Protected Types inherited from openPMD::Attributable
using Data_t = internal::AttributableData
 
- Protected Member Functions inherited from openPMD::RecordComponent
void flush (std::string const &, internal::FlushParams const &)
 
void read (bool require_unit_si)
 
- Protected Member Functions inherited from openPMD::BaseRecordComponent
Data_t const & get () const
 
Data_tget ()
 
void setData (std::shared_ptr< Data_t > data)
 
virtual void setDatasetDefined (Data_t &)
 
bool datasetDefined () const
 
 BaseRecordComponent (NoInit)
 
- Protected Attributes inherited from openPMD::BaseRecordComponent
std::shared_ptr< Data_tm_baseRecordComponentData
 
- Protected Attributes inherited from openPMD::Attributable
std::shared_ptr< Data_tm_attri
 

Detailed Description

Todo:
add support for constant patch record components

Constructor & Destructor Documentation

◆ PatchRecordComponent()

openPMD::PatchRecordComponent::PatchRecordComponent ( BaseRecord< PatchRecordComponent > const &  baseRecord)

Avoid object slicing when using a Record as a scalar Record Component.

It's still preferred to directly use the Record, or alternatively a Record-Component-type reference to a Record.

Member Function Documentation

◆ load()

template<typename T >
void openPMD::PatchRecordComponent::load ( std::shared_ptr< T >  data)
inline
Todo:
add support for constant patch record components

◆ resetDataset()

PatchRecordComponent & openPMD::PatchRecordComponent::resetDataset ( Dataset  d)
overridevirtual

Declare the dataset's type and extent.

Calling this again after flushing will require resizing the dataset. Support for this depends on the backend. Unsupported are:

  • Changing the datatype.
  • Shrinking any dimension's extent.
  • Changing the number of dimensions.

Backend support for resizing datasets:

  • JSON: Supported
  • ADIOS2: Supported as of ADIOS2 2.7.0
  • HDF5: (Currently) unsupported. Will be probably supported as soon as chunking is supported in HDF5.
Returns
RecordComponent&

Reimplemented from openPMD::RecordComponent.


The documentation for this class was generated from the following files: