23#include "openPMD/backend/Attributable.hpp"
24#include "openPMD/snapshots/ContainerTraits.hpp"
49class Snapshots :
public Attributable
54 std::shared_ptr<AbstractSnapshotsContainer> m_snapshots;
57 std::shared_ptr<AbstractSnapshotsContainer> snapshots,
58 Attributable &iterations);
64 using key_type = AbstractSnapshotsContainer::key_type;
65 using value_type = AbstractSnapshotsContainer::value_type;
66 using mapped_type = AbstractSnapshotsContainer::mapped_type;
67 using iterator = AbstractSnapshotsContainer::iterator;
68 using const_iterator = AbstractSnapshotsContainer::const_iterator;
71 using reverse_iterator = AbstractSnapshotsContainer::reverse_iterator;
72 using const_reverse_iterator =
73 AbstractSnapshotsContainer::const_reverse_iterator;
74 using size_type = AbstractSnapshotsContainer::size_type;
86 auto begin() -> iterator;
87 auto end() -> iterator;
90 auto begin()
const -> const_iterator;
93 auto end()
const -> const_iterator;
97 auto rbegin() -> reverse_iterator;
101 auto rend() -> reverse_iterator;
105 auto rbegin()
const -> const_reverse_iterator;
109 auto rend()
const -> const_reverse_iterator;
114 auto empty()
const -> bool;
119 auto size()
const -> size_t;
123 auto at(key_type
const &key)
const -> mapped_type
const &;
126 auto at(key_type
const &key) -> mapped_type &;
128 auto operator[](key_type
const &key) -> mapped_type &;
132 auto clear() -> void;
142 auto find(key_type
const &key) -> iterator;
150 auto find(key_type
const &key)
const -> const_iterator;
154 auto count(key_type
const &key)
const -> size_t;
158 auto contains(key_type
const &key)
const -> bool;
160 auto erase(key_type
const &key) -> size_type;
161 auto erase(iterator) -> iterator;
165 template <
typename... Args>
166 auto emplace(Args &&...args) -> std::pair<iterator, bool>
168 return m_snapshots->emplace({args...});
Definition ContainerTraits.hpp:118
Entry point for accessing Snapshots/Iterations.
Definition Snapshots.hpp:50
auto size() const -> size_t
Not implemented in synchronous workflow due to unclear semantics (past Iterations should not be consi...
Definition Snapshots.cpp:95
auto count(key_type const &key) const -> size_t
Implemented in terms of contains(), see there.
Definition Snapshots.cpp:127
auto contains(key_type const &key) const -> bool
Not implmented in synchronous workflow.
Definition Snapshots.cpp:132
auto at(key_type const &key) const -> mapped_type const &
Select an Iteration within the current IO step.
Definition Snapshots.cpp:100
auto find(key_type const &key) -> iterator
Not implmented in synchronous workflow.
Definition Snapshots.cpp:118
auto rbegin() -> reverse_iterator
Not implemented for synchronous workflow: Reverse iteration not possible.
Definition Snapshots.cpp:73
auto rend() -> reverse_iterator
Not implemented for synchronous workflow: Reverse iteration not possible.
Definition Snapshots.cpp:77
auto clear() -> void
Not implmented in synchronous workflow.
Definition Snapshots.cpp:113
auto empty() const -> bool
In synchronous workflow, this tells if there are remaining Iterations or not.
Definition Snapshots.cpp:91
auto currentIteration() -> std::optional< value_type * >
The currently active Iteration.
Definition Snapshots.cpp:48
Public definitions of openPMD-api.
Definition Date.cpp:29
SnapshotWorkflow
Enum used as a label for distinguishing the different Snapshots implementations.
Definition ContainerTraits.hpp:109