@@ -402,8 +402,8 @@ void CustomHierarchy::read(
402402
403403 std::deque<std::string> constantComponentsPushback;
404404 auto &data = get ();
405- EraseStaleMeshes meshesMap (data.embeddedMeshes ());
406- EraseStaleParticles particlesMap (data.embeddedParticles ());
405+ EraseStaleMeshes meshesMap (data.embeddedMeshesWrapped ());
406+ EraseStaleParticles particlesMap (data.embeddedParticlesWrapped ());
407407 for (auto const &path : *pList.paths )
408408 {
409409 switch (mpp.determineType (currentPath))
@@ -487,7 +487,8 @@ void CustomHierarchy::read(
487487 // Group is a bit of an internal misnomer here, it just means that
488488 // it matches neither meshes nor particles path
489489 case internal::ContainedType::Group: {
490- auto &rc = data.embeddedDatasets ()[path];
490+ auto embeddedDatasets = data.embeddedDatasetsWrapped ();
491+ auto &rc = embeddedDatasets[path];
491492 Parameter<Operation::OPEN_DATASET> dOpen;
492493 dOpen.name = path;
493494 IOHandler ()->enqueue (IOTask (&rc, dOpen));
@@ -505,7 +506,7 @@ void CustomHierarchy::read(
505506 << " ' at path '" << myPath ().openPMDPath ()
506507 << " ' and will skip it due to read error:\n "
507508 << err.what () << std::endl;
508- data. embeddedDatasets (). container () .erase (path);
509+ embeddedDatasets.erase (path);
509510 }
510511 break ;
511512 }
@@ -528,7 +529,8 @@ void CustomHierarchy::read(
528529
529530 for (auto const &path : constantComponentsPushback)
530531 {
531- auto &rc = data.embeddedDatasets ()[path];
532+ auto embeddedDatasets = data.embeddedDatasetsWrapped ();
533+ auto &rc = embeddedDatasets[path];
532534 try
533535 {
534536 Parameter<Operation::OPEN_PATH> pOpen;
@@ -543,7 +545,7 @@ void CustomHierarchy::read(
543545 << myPath ().openPMDPath () << " /" << path
544546 << " ' and will skip it due to read error:\n "
545547 << err.what () << std::endl;
546- data. embeddedDatasets (). container () .erase (path);
548+ embeddedDatasets.erase (path);
547549 }
548550 }
549551 setDirty (false );
@@ -580,7 +582,7 @@ void CustomHierarchy::flush_internal(
580582 subpath.flush_internal (flushParams, mpp, currentPath);
581583 currentPath.pop_back ();
582584 }
583- for (auto &[name, mesh] : data.embeddedMeshes ())
585+ for (auto &[name, mesh] : data.embeddedMeshesInternal ())
584586 {
585587 if (!mpp.isMeshContainer (currentPath))
586588 {
@@ -604,7 +606,7 @@ void CustomHierarchy::flush_internal(
604606 }
605607 mesh.flush (name, flushParams);
606608 }
607- for (auto &[name, particleSpecies] : data.embeddedParticles ())
609+ for (auto &[name, particleSpecies] : data.embeddedParticlesInternal ())
608610 {
609611 if (!mpp.isParticleContainer (currentPath))
610612 {
@@ -630,7 +632,7 @@ void CustomHierarchy::flush_internal(
630632 }
631633 particleSpecies.flush (name, flushParams);
632634 }
633- for (auto &[name, dataset] : get ().embeddedDatasets ())
635+ for (auto &[name, dataset] : get ().embeddedDatasetsInternal ())
634636 {
635637 dataset.flush (name, flushParams, /* set_defaults = */ false );
636638 }
@@ -653,27 +655,6 @@ void CustomHierarchy::linkHierarchy(Writable &w)
653655{
654656 Attributable::linkHierarchy (w);
655657}
656-
657- bool CustomHierarchy::dirtyRecursive () const
658- {
659- if (dirty ())
660- {
661- return true ;
662- }
663- auto check = [](auto const &container) {
664- for (auto const &pair : container)
665- {
666- if (pair.second .dirtyRecursive ())
667- {
668- return true ;
669- }
670- }
671- return false ;
672- };
673- auto &data = const_cast <Data_t &>(get ()); // @todo do this better
674- return check (data.embeddedMeshes ()) || check (data.embeddedParticles ()) ||
675- check (data.embeddedDatasets ()) || check (data.customHierarchies ());
676- }
677658} // namespace openPMD
678659
679660#undef OPENPMD_LEGAL_IDENTIFIER_CHARS
0 commit comments