Skip to content

Commit 19f5f88

Browse files
Document why m_backendAccess and m_frontendAccess are distinguished (#1337)
1 parent e0a74bd commit 19f5f88

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

include/openPMD/IO/AbstractIOHandler.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,21 @@ class AbstractIOHandler
211211
virtual std::string backendName() const = 0;
212212

213213
std::string const directory;
214-
// why do these need to be separate?
214+
/*
215+
* Originally, the reason for distinguishing these two was that during
216+
* parsing in reading access modes, the access type would be temporarily
217+
* const_cast'ed to an access type that would support modifying
218+
* the openPMD object model. Then, it would be const_cast'ed back to
219+
* READ_ONLY, to disable further modifications.
220+
* Due to this approach's tendency to cause subtle bugs, and due to its
221+
* difficult debugging properties, this was replaced by the SeriesStatus
222+
* enum, defined in this file.
223+
* The distinction of backendAccess and frontendAccess stays relevant, since
224+
* the frontend can use it in order to pretend to the backend that another
225+
* access type is being used. This is used by the file-based append mode,
226+
* which is entirely implemented by the frontend, which internally uses
227+
* the backend in CREATE mode.
228+
*/
215229
Access const m_backendAccess;
216230
Access const m_frontendAccess;
217231
internal::SeriesStatus m_seriesStatus = internal::SeriesStatus::Default;

0 commit comments

Comments
 (0)