Skip to content

Commit

Permalink
Add Attributable::touch()
Browse files Browse the repository at this point in the history
More flexible base API
  • Loading branch information
franzpoeschel committed Aug 6, 2024
1 parent c125299 commit ed91f9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions include/openPMD/backend/Attributable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ class Attributable
*/
MyPath myPath() const;

/**
* @brief Sets the object dirty to make internal procedures think it has
* been modified.
*/
void touch();

// clang-format off
OPENPMD_protected
// clang-format on
Expand Down
5 changes: 5 additions & 0 deletions src/backend/Attributable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ auto Attributable::myPath() const -> MyPath
return res;
}

void Attributable::touch()
{
setDirtyRecursive(true);
}

void Attributable::seriesFlush(
internal::FlushParams const &flushParams, bool flush_entire_series)
{
Expand Down
4 changes: 1 addition & 3 deletions src/backend/Writable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ void Writable::seriesFlush(
auto [iteration_internal, series_internal] = impl.containingIteration();
if (iteration_internal)
{
(*iteration_internal)
->asInternalCopyOf<Iteration>()
.setDirtyRecursive(true);
(*iteration_internal)->asInternalCopyOf<Iteration>().touch();
}
auto series = series_internal->asInternalCopyOf<Series>();
auto [begin, end] = [&, &iteration_internal_lambda = iteration_internal]()
Expand Down

0 comments on commit ed91f9e

Please sign in to comment.