Skip to content

Commit bcbd536

Browse files
committed
Regex-based list of meshes/particlesPaths
1 parent 150f172 commit bcbd536

File tree

3 files changed

+217
-79
lines changed

3 files changed

+217
-79
lines changed

include/openPMD/CustomHierarchy.hpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@
2020
*/
2121
#pragma once
2222

23+
#include "openPMD/IO/AbstractIOHandler.hpp"
2324
#include "openPMD/Mesh.hpp"
2425
#include "openPMD/ParticleSpecies.hpp"
2526
#include "openPMD/backend/Container.hpp"
2627

2728
#include <memory>
29+
#include <regex>
30+
#include <set>
31+
#include <string>
2832
#include <type_traits>
2933
#include <utility>
34+
#include <vector>
3035

3136
namespace openPMD
3237
{
@@ -41,24 +46,24 @@ namespace internal
4146
};
4247
struct MeshesParticlesPath
4348
{
44-
std::optional<std::string> meshesPath;
45-
std::optional<std::string> particlesPath;
46-
47-
inline std::string requestMeshesPath()
48-
{
49-
meshesPath = meshesPath.value_or("meshes");
50-
return *meshesPath;
51-
}
52-
inline std::string requestParticlesPath()
53-
{
54-
particlesPath = particlesPath.value_or("particles");
55-
return *particlesPath;
56-
}
49+
std::regex meshRegex;
50+
std::set<std::string> collectNewMeshesPaths;
51+
std::regex particleRegex;
52+
std::set<std::string> collectNewParticlesPaths;
53+
54+
/*
55+
* These values decide which path will be returned upon use of the
56+
* shorthand notation s.iterations[0].meshes or .particles.
57+
*
58+
*/
59+
std::string m_defaultMeshesPath = "meshes";
60+
std::string m_defaultParticlesPath = "particles";
5761

5862
explicit MeshesParticlesPath() = default;
5963
MeshesParticlesPath(
60-
std::optional<std::string> meshesPath,
61-
std::optional<std::string> particlesPath);
64+
std::vector<std::string> const &meshes,
65+
std::vector<std::string> const &particles);
66+
MeshesParticlesPath(Series const &);
6267

6368
[[nodiscard]] ContainedType determineType(
6469
std::vector<std::string> const &path,

0 commit comments

Comments
 (0)