Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/RecordComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,20 @@ namespace internal
Attributable a;
a.setData(std::shared_ptr<AttributableData>{this, [](auto const &) {}});
// this check can be too costly in some setups
#if 0
if (a.containingIteration().closed())
#if openPMD_USE_INVASIVE_TESTS

auto maybe_an_iteration = a.containingIteration().first;
if (!maybe_an_iteration.has_value())
{
throw error::WrongAPIUsage(
throw std::runtime_error(
"Trying to write to/read from a RecordComponent that is not "
"contained by any Iteration.");
}
auto &iterationData = *maybe_an_iteration.value();
auto iteration = iterationData.asInternalCopyOf<Iteration>();
if (iteration.closed() && !iterationData.allow_reopening_implicitly)
{
throw std::runtime_error(
"Cannot write/read chunks to/from closed Iterations.");
}
#endif
Expand Down
Loading