1919
2020namespace openPMD
2121{
22-
23- namespace internal
24- {
25- ConfigureLoadStoreData::ConfigureLoadStoreData (RecordComponent &rc)
26- : m_rc(rc)
27- {}
28- } // namespace internal
29-
3022namespace
3123{
3224 template <typename T>
@@ -63,25 +55,26 @@ namespace
6355 }
6456} // namespace
6557
58+ ConfigureLoadStoreCore::ConfigureLoadStoreCore (RecordComponent &rc) : m_rc(rc)
59+ {}
60+
6661template <typename ChildClass>
6762ConfigureLoadStore<ChildClass>::ConfigureLoadStore(RecordComponent &rc)
68- : ConfigureLoadStoreData (rc)
63+ : ConfigureLoadStoreCore (rc)
6964{}
7065
7166template <typename ChildClass>
7267ConfigureLoadStore<ChildClass>::ConfigureLoadStore(
73- internal::ConfigureLoadStoreData &&data)
74- : ConfigureLoadStoreData (std::move(data))
68+ ConfigureLoadStoreCore &&data)
69+ : ConfigureLoadStoreCore (std::move(data))
7570{}
7671
77- template <typename ChildClass>
78- auto ConfigureLoadStore<ChildClass>::dim() const -> uint8_t
72+ auto ConfigureLoadStoreCore::dim () const -> uint8_t
7973{
8074 return m_rc.getDimensionality ();
8175}
8276
83- template <typename ChildClass>
84- auto ConfigureLoadStore<ChildClass>::getOffset() -> Offset const &
77+ auto ConfigureLoadStoreCore::getOffset () -> Offset const &
8578{
8679 if (!m_offset.has_value ())
8780 {
@@ -97,8 +90,7 @@ auto ConfigureLoadStore<ChildClass>::getOffset() -> Offset const &
9790 return *m_offset;
9891}
9992
100- template <typename ChildClass>
101- auto ConfigureLoadStore<ChildClass>::getExtent() -> Extent const &
93+ auto ConfigureLoadStoreCore::getExtent () -> Extent const &
10294{
10395 if (!m_extent.has_value ())
10496 {
@@ -118,9 +110,7 @@ auto ConfigureLoadStore<ChildClass>::getExtent() -> Extent const &
118110 return *m_extent;
119111}
120112
121- template <typename ChildClass>
122- auto ConfigureLoadStore<ChildClass>::storeChunkConfig()
123- -> internal::LoadStoreConfig
113+ auto ConfigureLoadStoreCore::storeChunkConfig () -> internal::LoadStoreConfig
124114{
125115 return internal::LoadStoreConfig{getOffset (), getExtent ()};
126116}
@@ -139,17 +129,14 @@ auto ConfigureLoadStore<ChildClass>::offset(Offset offset) -> return_type &
139129 return *static_cast <return_type *>(this );
140130}
141131
142- template <typename ChildClass>
143132template <typename T>
144- auto ConfigureLoadStore<ChildClass> ::enqueueStore() -> DynamicMemoryView<T>
133+ auto ConfigureLoadStoreCore ::enqueueStore () -> DynamicMemoryView<T>
145134{
146135 return m_rc.storeChunkSpan_impl <T>(storeChunkConfig ());
147136}
148137
149- template <typename ChildClass>
150138template <typename T>
151- auto ConfigureLoadStore<ChildClass>::enqueueLoad()
152- -> std::future<std::shared_ptr<T>>
139+ auto ConfigureLoadStoreCore::enqueueLoad () -> std::future<std::shared_ptr<T>>
153140{
154141 auto res = m_rc.loadChunkAllocate_impl <T>(storeChunkConfig ());
155142 return std::async (
@@ -160,10 +147,8 @@ auto ConfigureLoadStore<ChildClass>::enqueueLoad()
160147 });
161148}
162149
163- template <typename ChildClass>
164150template <typename T>
165- auto ConfigureLoadStore<ChildClass>::load(EnqueuePolicy ep)
166- -> std::shared_ptr<T>
151+ auto ConfigureLoadStoreCore::load (EnqueuePolicy ep) -> std::shared_ptr<T>
167152{
168153 auto res = m_rc.loadChunkAllocate_impl <T>(storeChunkConfig ());
169154 switch (ep)
@@ -201,8 +186,7 @@ struct VisitorEnqueueLoadVariant
201186 }
202187};
203188
204- template <typename ChildClass>
205- auto ConfigureLoadStore<ChildClass>::enqueueLoadVariant()
189+ auto ConfigureLoadStoreCore::enqueueLoadVariant ()
206190 -> std::future<auxiliary::detail::future_to_shared_ptr_dataset_types>
207191{
208192 return VisitorEnqueueLoadVariant::non_templated_implementation (
@@ -297,21 +281,20 @@ auto ConfigureLoadStoreFromBuffer<Ptr_Type>::load(EnqueuePolicy ep) -> void
297281
298282/* clang-format would destroy the NOLINT comments */
299283// clang-format off
300- #define INSTANTIATE_METHOD_TEMPLATES (base_class, dtype ) \
301- template auto base_class::enqueueStore ()->DynamicMemoryView<dtype>; \
302- template auto base_class::enqueueLoad () \
303- /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
284+ #define INSTANTIATE_METHOD_TEMPLATES (dtype ) \
285+ template auto ConfigureLoadStoreCore::enqueueStore () \
286+ ->DynamicMemoryView<dtype>; \
287+ template auto ConfigureLoadStoreCore::enqueueLoad () \
288+ /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
304289 ->std::future<std::shared_ptr<dtype>>; \
305- template auto base_class::load (EnqueuePolicy)->std::shared_ptr<dtype>;
290+ template auto ConfigureLoadStoreCore::load (EnqueuePolicy) \
291+ ->std::shared_ptr<dtype>;
306292// clang-format on
307293
308- #define INSTANTIATE_METHOD_TEMPLATES_FOR_BASE (dtype ) \
309- INSTANTIATE_METHOD_TEMPLATES (ConfigureLoadStore<void >, dtype)
310-
311294template class ConfigureLoadStore <void >;
312- OPENPMD_FOREACH_DATASET_DATATYPE (INSTANTIATE_METHOD_TEMPLATES_FOR_BASE )
295+ OPENPMD_FOREACH_DATASET_DATATYPE (INSTANTIATE_METHOD_TEMPLATES )
313296
314- #undef INSTANTIATE_METHOD_TEMPLATES_FOR_BASE
297+ #undef INSTANTIATE_METHOD_TEMPLATES
315298
316299/* clang-format would destroy the NOLINT comments */
317300// clang-format off
@@ -325,37 +308,19 @@ OPENPMD_FOREACH_DATASET_DATATYPE(INSTANTIATE_METHOD_TEMPLATES_FOR_BASE)
325308 template class ConfigureLoadStore < \
326309 /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
327310 ConfigureLoadStoreFromBuffer<std::shared_ptr<dtype>>>; \
328- INSTANTIATE_METHOD_TEMPLATES ( \
329- ConfigureLoadStore< \
330- /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
331- ConfigureLoadStoreFromBuffer<std::shared_ptr<dtype>>>, \
332- dtype) \
333311 /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
334312 template class ConfigureStoreChunkFromBuffer <UniquePtrWithLambda<dtype>>; \
335313 template class ConfigureLoadStore < \
336314 /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
337315 ConfigureStoreChunkFromBuffer<UniquePtrWithLambda<dtype>>>; \
338- INSTANTIATE_METHOD_TEMPLATES ( \
339- ConfigureLoadStore< \
340- /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
341- ConfigureStoreChunkFromBuffer<UniquePtrWithLambda<dtype>>>, \
342- dtype) \
343316 template class ConfigureStoreChunkFromBuffer < \
344317 std::shared_ptr<dtype const >>; \
345318 template class ConfigureLoadStore < \
346319 ConfigureStoreChunkFromBuffer<std::shared_ptr<dtype const >>>; \
347- INSTANTIATE_METHOD_TEMPLATES ( \
348- ConfigureLoadStore< \
349- ConfigureStoreChunkFromBuffer<std::shared_ptr<dtype const >>>, \
350- dtype) \
351320 template class ConfigureStoreChunkFromBuffer < \
352321 UniquePtrWithLambda<dtype const >>; \
353322 template class ConfigureLoadStore < \
354- ConfigureStoreChunkFromBuffer<UniquePtrWithLambda<dtype const >>>; \
355- INSTANTIATE_METHOD_TEMPLATES ( \
356- ConfigureLoadStore< \
357- ConfigureStoreChunkFromBuffer<UniquePtrWithLambda<dtype const >>>, \
358- dtype)
323+ ConfigureStoreChunkFromBuffer<UniquePtrWithLambda<dtype const >>>;
359324// clang-format on
360325
361326OPENPMD_FOREACH_DATASET_DATATYPE (INSTANTIATE_STORE_CHUNK_FROM_BUFFER)
0 commit comments