openPMD-api
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
openPMD::BaseRecord< T_elem > Class Template Referenceabstract

Base class for any type of record (e.g. More...

#include <BaseRecord.hpp>

Inheritance diagram for openPMD::BaseRecord< T_elem >:
Inheritance graph
[legend]
Collaboration diagram for openPMD::BaseRecord< T_elem >:
Collaboration graph
[legend]

Public Types

using T_RecordComponent = T_elem
 
using T_Container = Container< T_elem >
 
using key_type = typename Container< T_elem >::key_type
 
using mapped_type = typename Container< T_elem >::mapped_type
 
using value_type = typename Container< T_elem >::value_type
 
using size_type = typename Container< T_elem >::size_type
 
using difference_type = typename Container< T_elem >::difference_type
 
using allocator_type = typename Container< T_elem >::allocator_type
 
using reference = typename Container< T_elem >::reference
 
using const_reference = typename Container< T_elem >::const_reference
 
using pointer = typename Container< T_elem >::pointer
 
using const_pointer = typename Container< T_elem >::const_pointer
 
using iterator = internal::ScalarIterator< T_Self, Data_t, typename T_Container::InternalContainer::iterator >
 
using const_iterator = internal::ScalarIterator< T_Self const, Data_t const, typename T_Container::InternalContainer::const_iterator >
 
using reverse_iterator = internal::ScalarIterator< T_Self, Data_t, typename T_Container::InternalContainer::reverse_iterator >
 
using const_reverse_iterator = internal::ScalarIterator< T_Self const, Data_t const, typename T_Container::InternalContainer::const_reverse_iterator >
 
- Public Types inherited from openPMD::Container< T_elem >
using key_type = typename InternalContainer::key_type
 
using mapped_type = typename InternalContainer::mapped_type
 
using value_type = typename InternalContainer::value_type
 
using size_type = typename InternalContainer::size_type
 
using difference_type = typename InternalContainer::difference_type
 
using allocator_type = typename InternalContainer::allocator_type
 
using reference = typename InternalContainer::reference
 
using const_reference = typename InternalContainer::const_reference
 
using pointer = typename InternalContainer::pointer
 
using const_pointer = typename InternalContainer::const_pointer
 
using iterator = typename InternalContainer::iterator
 
using const_iterator = typename InternalContainer::const_iterator
 
using reverse_iterator = typename InternalContainer::reverse_iterator
 
using const_reverse_iterator = typename InternalContainer::const_reverse_iterator
 
- Public Types inherited from openPMD::Attributable
enum  ReadMode { IgnoreExisting , OverrideExisting , FullyReread }
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator crbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator crend () const
 
mapped_type & operator[] (key_type const &key)
 
mapped_type & operator[] (key_type &&key)
 
mapped_type & at (key_type const &key)
 
mapped_type const & at (key_type const &key) const
 
size_type erase (key_type const &key)
 
iterator erase (iterator res)
 
bool empty () const noexcept
 
iterator find (key_type const &key)
 
const_iterator find (key_type const &key) const
 
size_type count (key_type const &key) const
 
size_type size () const
 
void clear ()
 
std::pair< iterator, bool > insert (value_type const &value)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, value_type const &value)
 
iterator insert (const_iterator hint, value_type &&value)
 
template<class InputIt >
void insert (InputIt first, InputIt last)
 
void insert (std::initializer_list< value_type > ilist)
 
void swap (BaseRecord &other)
 
bool contains (key_type const &key) const
 
template<class... Args>
auto emplace (Args &&...args) -> std::pair< iterator, bool >
 
std::array< double, 7 > unitDimension () const
 Return the physical dimension (quantity) of a record. More...
 
void setDatasetDefined (BaseRecordComponent::Data_t &data) override
 
bool scalar () const
 Returns true if this record only contains a single component. More...
 
template<typename InputIt >
auto insert (InputIt first, InputIt last) -> void
 
- Public Member Functions inherited from openPMD::Container< T_elem >
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cbegin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crend () const noexcept
 
bool empty () const noexcept
 
size_type size () const noexcept
 
void clear ()
 Remove all objects from the container and (if written) from disk. More...
 
std::pair< iterator, bool > insert (value_type const &value)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, value_type const &value)
 
iterator insert (const_iterator hint, value_type &&value)
 
void insert (InputIt first, InputIt last)
 
void insert (std::initializer_list< value_type > ilist)
 
void swap (Container &other)
 
mapped_type & at (key_type const &key)
 
mapped_type const & at (key_type const &key) const
 
mapped_type & operator[] (key_type const &key)
 Access the value that is mapped to a key equivalent to key, creating it if such key does not exist already. More...
 
mapped_type & operator[] (key_type &&key)
 Access the value that is mapped to a key equivalent to key, creating it if such key does not exist already. More...
 
iterator find (key_type const &key)
 
const_iterator find (key_type const &key) const
 
size_type count (key_type const &key) const
 This returns either 1 if the key is found in the container of 0 if not. More...
 
bool contains (key_type const &key) const
 Checks if there is an element with a key equivalent to an exiting key in the container. More...
 
size_type erase (key_type const &key)
 Remove a single element from the container and (if written) from disk. More...
 
iterator erase (iterator res)
 
auto emplace (Args &&...args) -> decltype(InternalContainer().emplace(std::forward< Args >(args)...))
 
protected void clear_unchecked ()
 
 Container (NoInit)
 
 Container (Container const &other)
 
 Container (Container &&other)
 
Containeroperator= (Container const &other)
 
Containeroperator= (Container &&other)
 
- 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 ()
 

Protected Member Functions

void setData (std::shared_ptr< Data_t > data)
 
void readBase ()
 
- Protected Member Functions inherited from openPMD::Container< T_elem >
void setData (std::shared_ptr< ContainerData > containerData)
 
InternalContainer const & container () const
 
InternalContainer & container ()
 

Friends

class Iteration
 
class ParticleSpecies
 
class PatchRecord
 
class Record
 
class Mesh
 
template<typename , typename >
class internal::BaseRecordData
 
template<typename , typename , typename >
class internal::ScalarIterator
 

Additional Inherited Members

- Protected Types inherited from openPMD::Container< T_elem >
using ContainerData = internal::ContainerData< T_elem, std::string, std::map< std::string, T_elem > >
 
using InternalContainer = std::map< std::string, T_elem >
 
- Protected Types inherited from openPMD::Attributable
using Data_t = internal::AttributableData
 
- Protected Attributes inherited from openPMD::Container< T_elem >
std::shared_ptr< ContainerDatam_containerData
 
- Protected Attributes inherited from openPMD::Attributable
std::shared_ptr< Data_tm_attri
 

Detailed Description

template<typename T_elem>
class openPMD::BaseRecord< T_elem >

Base class for any type of record (e.g.

mesh or particle record).

If the record is a vector record, the single components are accessed via the container interface (base class 1). If the record is a scalar record, it directly acts as a record component (base class 2) and the Container API needs not be used.

Template Parameters
T_elem

Member Function Documentation

◆ scalar()

template<typename T_elem >
bool openPMD::BaseRecord< T_elem >::scalar
inline

Returns true if this record only contains a single component.

Returns
true if a record with only a single component

◆ unitDimension()

template<typename T_elem >
std::array< double, 7 > openPMD::BaseRecord< T_elem >::unitDimension
inline

Return the physical dimension (quantity) of a record.

Todo:
add also, as soon as added in Container:

Annotating the physical dimension of a record allows us to read data sets with arbitrary names and understand their purpose simply by dimensional analysis. The dimensional base quantities in openPMD are in order: length (L), mass (M), time (T), electric current (I), thermodynamic temperature (theta), amount of substance (N), luminous intensity (J) after the international system of quantities (ISQ).

See also
https://en.wikipedia.org/wiki/Dimensional_analysis
https://en.wikipedia.org/wiki/International_System_of_Quantities#Base_quantities
https://github.com/openPMD/openPMD-standard/blob/1.1.0/STANDARD.md#required-for-each-record
Returns
powers of the 7 base measures in the order specified above

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