Skip to content

Commit e9a242c

Browse files
committed
Fix visithierarchy
1 parent 2be85f0 commit e9a242c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

include/openPMD/backend/BaseRecord.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ class BaseRecord
366366
*/
367367
bool scalar() const;
368368

369+
template <typename Visitor>
370+
void visitHierarchy(Visitor &&v)
371+
{
372+
v(*this);
373+
for (auto &p : *this)
374+
{
375+
p.second.visitHierarchy(v);
376+
}
377+
}
378+
369379
private:
370380
void flush(std::string const &, internal::FlushParams const &) final;
371381
virtual void

include/openPMD/backend/Container.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class Container : virtual public Attributable
268268
v(*this);
269269
for (auto &p : *this)
270270
{
271-
p.second.visitHierarchy();
271+
p.second.visitHierarchy(v);
272272
}
273273
}
274274

0 commit comments

Comments
 (0)