@@ -44,6 +44,17 @@ namespace internal
44
44
std::optional<std::string> meshesPath;
45
45
std::optional<std::string> particlesPath;
46
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
+ }
57
+
47
58
explicit MeshesParticlesPath () = default;
48
59
MeshesParticlesPath (
49
60
std::optional<std::string> meshesPath,
@@ -67,6 +78,8 @@ namespace internal
67
78
void syncAttributables ();
68
79
69
80
Container<RecordComponent> m_embeddedDatasets;
81
+ Container<Mesh> m_embeddedMeshes;
82
+ Container<ParticleSpecies> m_embeddedParticles;
70
83
};
71
84
} // namespace internal
72
85
@@ -91,8 +104,12 @@ class CustomHierarchy : public Container<CustomHierarchy>
91
104
return *m_customHierarchyData;
92
105
}
93
106
94
- void readMeshes (std::string const &meshesPath);
95
- void readParticles (std::string const &particlesPath);
107
+ using EraseStaleMeshes = internal::EraseStaleEntries<Container<Mesh>>;
108
+ using EraseStaleParticles =
109
+ internal::EraseStaleEntries<Container<ParticleSpecies>>;
110
+ void readNonscalarMesh (EraseStaleMeshes &map, std::string const &name);
111
+ void readScalarMesh (EraseStaleMeshes &map, std::string const &name);
112
+ void readParticleSpecies (EraseStaleParticles &map, std::string const &name);
96
113
97
114
protected:
98
115
CustomHierarchy ();
@@ -139,10 +156,17 @@ class CustomHierarchy : public Container<CustomHierarchy>
139
156
CustomHierarchy &operator =(CustomHierarchy const &) = default ;
140
157
CustomHierarchy &operator =(CustomHierarchy &&) = default ;
141
158
159
+ mapped_type &operator [](key_type &&key);
160
+ mapped_type &operator [](key_type const &key);
161
+
142
162
template <typename ContainedType>
143
163
auto asContainerOf () -> Container<ContainedType> &;
144
164
145
165
Container<Mesh> meshes{};
146
166
Container<ParticleSpecies> particles{};
167
+
168
+ private:
169
+ template <typename KeyType>
170
+ mapped_type &bracketOperatorImpl (KeyType &&);
147
171
};
148
172
} // namespace openPMD
0 commit comments