openPMD-api
 
Loading...
Searching...
No Matches
openPMD::Snapshots Class Reference

Entry point for accessing Snapshots/Iterations. More...

#include <Snapshots.hpp>

Inheritance diagram for openPMD::Snapshots:
openPMD::Attributable

Public Types

using key_type = AbstractSnapshotsContainer::key_type
 
using value_type = AbstractSnapshotsContainer::value_type
 
using mapped_type = AbstractSnapshotsContainer::mapped_type
 
using iterator = AbstractSnapshotsContainer::iterator
 
using const_iterator = AbstractSnapshotsContainer::const_iterator
 
using reverse_iterator = AbstractSnapshotsContainer::reverse_iterator
 
using const_reverse_iterator
 
using size_type = AbstractSnapshotsContainer::size_type
 

Public Member Functions

auto currentIteration () -> std::optional< value_type * >
 The currently active Iteration.
 
auto currentIteration () const -> std::optional< value_type const * >
 
auto begin () -> iterator
 
auto end () -> iterator
 
auto begin () const -> const_iterator
 Not implemented for synchronous workflow: Const iteration not possible.
 
auto end () const -> const_iterator
 Not implemented for synchronous workflow: Const iteration not possible.
 
auto rbegin () -> reverse_iterator
 Not implemented for synchronous workflow: Reverse iteration not possible.
 
auto rend () -> reverse_iterator
 Not implemented for synchronous workflow: Reverse iteration not possible.
 
auto rbegin () const -> const_reverse_iterator
 Not implemented for synchronous workflow: Const reverse iteration not possible.
 
auto rend () const -> const_reverse_iterator
 Not implemented for synchronous workflow: Const reverse iteration not possible.
 
auto empty () const -> bool
 In synchronous workflow, this tells if there are remaining Iterations or not.
 
auto size () const -> size_t
 Not implemented in synchronous workflow due to unclear semantics (past Iterations should not be considered, future Iterations are not yet known).
 
auto at (key_type const &key) const -> mapped_type const &
 Select an Iteration within the current IO step.
 
auto at (key_type const &key) -> mapped_type &
 Select an Iteration within the current IO step.
 
auto operator[] (key_type const &key) -> mapped_type &
 
auto clear () -> void
 Not implmented in synchronous workflow.
 
auto find (key_type const &key) -> iterator
 Not implmented in synchronous workflow.
 
auto find (key_type const &key) const -> const_iterator
 Not implmented in synchronous workflow.
 
auto count (key_type const &key) const -> size_t
 Implemented in terms of contains(), see there.
 
auto contains (key_type const &key) const -> bool
 Not implmented in synchronous workflow.
 
auto erase (key_type const &key) -> size_type
 
auto erase (iterator) -> iterator
 
template<typename... Args>
auto emplace (Args &&...args) -> std::pair< iterator, bool >
 
auto snapshotWorkflow () const -> SnapshotWorkflow
 
- Public Member Functions inherited from openPMD::Attributable
 Attributable (NoInit) noexcept
 
Attribute getAttribute (std::string const &key) const
 Retrieve value of Attribute stored with provided key.
 
bool deleteAttribute (std::string const &key)
 Remove Attribute of provided value both logically and physically.
 
std::vector< std::string > attributes () const
 List all currently stored Attributes' keys.
 
size_t numAttributes () const
 Count all currently stored Attributes.
 
bool containsAttribute (std::string const &key) const
 Check whether am Attribute with a given key exists.
 
std::string comment () const
 Retrieve a user-supplied comment associated with the object.
 
AttributablesetComment (std::string const &comment)
 Populate Attribute corresponding to a comment with the user-supplied comment.
 
void seriesFlush (std::string backendConfig="{}")
 Flush the corresponding Series object.
 
void iterationFlush (std::string backendConfig="{}")
 Flush the containing Iteration.
 
MyPath myPath () const
 The path to this object within its containing Series.
 
void touch ()
 Sets the object dirty to make internal procedures think it has been modified.
 
OpenpmdStandard openPMDStandard () const
 
template<typename T>
bool setAttribute (std::string const &key, T value)
 Populate Attribute of provided name with provided value.
 
bool setAttribute (std::string const &key, char const value[])
 

Friends

class Series
 

Additional Inherited Members

- Protected Types inherited from openPMD::Attributable
enum  ReadMode { IgnoreExisting , OverrideExisting , FullyReread }
 
enum class  EnqueueAsynchronously : bool { Yes , No }
 
using Data_t = internal::AttributableData
 
- Protected Member Functions inherited from openPMD::Attributable
Series retrieveSeries () const
 
template<bool flush_entire_series>
void seriesFlush_impl (internal::FlushParams const &)
 
void flushAttributes (internal::FlushParams const &)
 
void readAttributes (ReadMode)
 
template<typename T>
T readFloatingpoint (std::string const &key) const
 Retrieve the value of a floating point Attribute of user-defined precision with ensured type-safety.
 
template<typename T>
std::vector< TreadVectorFloatingpoint (std::string const &key) const
 Retrieve a vector of values of a floating point Attributes of user-defined precision with ensured type-safety.
 
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::SharedAttributableDataget ()
 
internal::SharedAttributableData const & get () const
 
bool dirty () const
 
bool dirtyRecursive () const
 O(1).
 
void setDirty (bool dirty_in)
 
void setDirtyRecursive (bool dirty_in)
 
bool written () const
 
void setWritten (bool val, EnqueueAsynchronously)
 
auto containingIteration () const -> std::pair< std::optional< internal::IterationData const * >, internal::SeriesData const * >
 Returns the corresponding Iteration.
 
auto containingIteration () -> std::pair< std::optional< internal::IterationData * >, internal::SeriesData * >
 
- Protected Attributes inherited from openPMD::Attributable
std::shared_ptr< Data_tm_attri
 

Detailed Description

Entry point for accessing Snapshots/Iterations.

Common API for different Snapshot accessing workflows.

Refer to Series::snapshots() for a detailed description of different workflows and their applications. The API generally follows the Container/map conventions, though especially the synchronous workflow does not implement all of the API calls.

Since the synchronous workflow is tailored to support use cases from ADIOS2 which do not support going back to the start (IO steps, streaming), the Container semantics are based on the remaining Iterations that have not yet been seen. Especially does this mean that Snapshots::begin() does not reset the Iterator back to the start, but will return the current state. There is restricted support for going back to past Iterations by reopening them under the condition that no previous ADIOS2 step needs to be activated. Note that an Iteration handle goes invalid after closing it, a new Iteration handle is acquired by Snapshots::operator[]().

Member Typedef Documentation

◆ const_reverse_iterator

Initial value:
AbstractSnapshotsContainer::const_reverse_iterator

Member Function Documentation

◆ currentIteration()

auto openPMD::Snapshots::currentIteration ( ) -> std::optional<value_type *>

The currently active Iteration.

Mostly useful for the synchronous workflow, since that has a notion of global state where a specific Iteration is currently active (or no Iteration, in which case a nullopt is returned). For random-access workflow, the first Iteration in the Series is returned.

◆ find() [1/2]

auto openPMD::Snapshots::find ( key_type const & key) -> iterator

Not implmented in synchronous workflow.

(In future: Might be implemented in terms of searching within the current IO step)

◆ find() [2/2]

auto openPMD::Snapshots::find ( key_type const & key) const -> const_iterator

Not implmented in synchronous workflow.

(In future: Might be implemented in terms of checking the current Iteration against the searched key and returning end() if it doesn't match. Anything else is not possible since the shared Iterator would have to be modified.)


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