Skip to content

Commit

Permalink
Document new internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jun 25, 2024
1 parent ed86441 commit e5c705b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/openPMD/backend/Attributable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ namespace internal

class RecordComponentData;

/*
* Internal function to turn a handle into an owning handle that will keep
* not only itself, but the entire Series alive. Works by hiding a copy of
* the Series into the destructor lambda of the internal shared pointer. The
* returned handle is entirely safe to use in just the same ways as a normal
* handle, just the surrounding Series needs not be kept alive any more
* since it is stored within the handle. By storing the Series in the
* handle, not in the actual data, reference cycles are avoided.
*
* Instantiations for T exist for types RecordComponent,
* MeshRecordComponent, Mesh, Record, ParticleSpecies, Iteration.
*/
template <typename T>
T &makeOwning(T &self, Series);
} // namespace internal
Expand Down

0 comments on commit e5c705b

Please sign in to comment.