Skip to content

Commit b27648c

Browse files
committed
Add some documentatioAdd some documentation
1 parent c320171 commit b27648c

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

include/openPMD/Iteration.hpp

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,39 @@ class Iteration : public Attributable
8888
Iteration& setTimeUnitSI(double newTimeUnitSI);
8989

9090
/**
91-
* @brief Declare an iteration finalized. Indicates that no further
92-
* alterations will be made to this iteration.
93-
* @return Reference to modified iteration.
91+
* @brief Close an iteration. No further (backend-propagating) accesses
92+
* may be performed on this iteration.
93+
* A closed iteration may not (yet) be reopened.
94+
* @return Reference to iteration.
95+
*/
96+
/*
97+
* Note: If the API is changed in future to allow reopening closed
98+
* iterations, measures should be taken to prevent this in the streaming
99+
* API. Currently, disallowing to reopen closed iterations satisfies
100+
* the requirements of the streaming API.
94101
*/
95102
Iteration &
96103
close( bool flush = true );
97104

105+
/**
106+
* @brief Has the iteration been closed?
107+
* A closed iteration may not (yet) be reopened.
108+
*
109+
* @return Whether the iteration has been closed.
110+
*/
98111
bool
99112
closed() const;
100113

114+
/**
115+
* @brief Has the iteration been closed by the writer?
116+
* Background: Upon calling Iteration::close(), the openPMD API
117+
* will add metadata to the iteration in form of an attribute,
118+
* indicating that the iteration has indeed been closed.
119+
* Useful mainly in streaming context.
120+
*
121+
* @return Whether the iteration has been explicitly closed (yet) by the
122+
* writer.
123+
*/
101124
bool
102125
closedByWriter() const;
103126

0 commit comments

Comments
 (0)