@@ -113,15 +113,15 @@ namespace core
113113 }
114114
115115 template <typename T>
116- auto ConfigureLoadStore::enqueueLoad () -> std::future<std::shared_ptr<T>>
116+ auto ConfigureLoadStore::enqueueLoad ()
117+ -> auxiliary::DeferredFuture<std::shared_ptr<T>>
117118 {
118119 auto res = m_rc.loadChunkAllocate_impl <T>(storeChunkConfig ());
119- return std::async (
120- std::launch::deferred,
120+ return auxiliary::DeferredFuture (std::packaged_task (
121121 [res_lambda = std::move (res), rc = m_rc]() mutable {
122122 rc.seriesFlush ();
123123 return res_lambda;
124- });
124+ })) ;
125125 }
126126
127127 template <typename T>
@@ -143,21 +143,22 @@ namespace core
143143 {
144144 template <typename T>
145145 static auto call (RecordComponent &rc, internal::LoadStoreConfig cfg)
146- -> std::future<auxiliary::detail::shared_ptr_dataset_types>
146+ -> auxiliary::DeferredFuture<
147+ auxiliary::detail::shared_ptr_dataset_types>
147148 {
148149 auto res = rc.loadChunkAllocate_impl <T>(std::move (cfg));
149- return std::async (
150- std::launch::deferred,
150+ return auxiliary::DeferredFuture (std::packaged_task (
151151 [res_lambda = std::move (res), rc_lambda = rc]() mutable
152152 -> auxiliary::detail::shared_ptr_dataset_types {
153153 rc_lambda.seriesFlush ();
154154 return res_lambda;
155- });
155+ })) ;
156156 }
157157 };
158158
159159 auto ConfigureLoadStore::enqueueLoadVariant ()
160- -> std::future<auxiliary::detail::shared_ptr_dataset_types>
160+ -> auxiliary::DeferredFuture<
161+ auxiliary::detail::shared_ptr_dataset_types>
161162 {
162163 return m_rc.visit <VisitorEnqueueLoadVariant>(this ->storeChunkConfig ());
163164 }
@@ -202,16 +203,15 @@ namespace core
202203 }
203204
204205 template <typename Ptr_Type>
205- auto
206- ConfigureStoreChunkFromBuffer<Ptr_Type>::enqueueStore() -> std::future <void >
206+ auto ConfigureStoreChunkFromBuffer<Ptr_Type>::enqueueStore()
207+ -> auxiliary::DeferredFuture <void >
207208 {
208209 this ->m_rc .storeChunk_impl (
209210 asWriteBuffer (std::move (m_buffer)),
210211 determineDatatype<auxiliary::IsPointer_t<Ptr_Type>>(),
211212 storeChunkConfig ());
212- return std::async (
213- std::launch::deferred,
214- [rc_lambda = m_rc]() mutable -> void { rc_lambda.seriesFlush (); });
213+ return auxiliary::DeferredFuture (std::packaged_task (
214+ [rc_lambda = m_rc]() mutable -> void { rc_lambda.seriesFlush (); }));
215215 }
216216
217217 template <typename Ptr_Type>
@@ -300,7 +300,7 @@ template class compose::ConfigureLoadStore<ConfigureLoadStore>;
300300 template auto core::ConfigureLoadStore::enqueueStore () \
301301 -> DynamicMemoryView<dtype>; \
302302 template auto core::ConfigureLoadStore::enqueueLoad () \
303- -> std::future <std::shared_ptr<dtype>>; \
303+ -> auxiliary::DeferredFuture <std::shared_ptr<dtype>>; \
304304 template auto core::ConfigureLoadStore::load (EnqueuePolicy) \
305305 ->std::shared_ptr<dtype>;
306306// clang-format on
@@ -310,13 +310,15 @@ OPENPMD_FOREACH_DATASET_DATATYPE(INSTANTIATE_METHOD_TEMPLATES)
310310#undef INSTANTIATE_METHOD_TEMPLATES
311311
312312/* clang-format would destroy the NOLINT comments */
313- // // clang-format off
313+ // clang-format off
314314#define INSTANTIATE_HALF (pointer_type ) \
315315 template class ConfigureStoreChunkFromBuffer <pointer_type>; \
316316 template class core ::ConfigureStoreChunkFromBuffer<pointer_type>; \
317317 template class compose ::ConfigureLoadStore< \
318+ /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
318319 ConfigureStoreChunkFromBuffer<pointer_type>>; \
319320 template class compose ::ConfigureStoreChunkFromBuffer< \
321+ /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
320322 ConfigureStoreChunkFromBuffer<pointer_type>>;
321323// clang-format on
322324
@@ -325,7 +327,7 @@ OPENPMD_FOREACH_DATASET_DATATYPE(INSTANTIATE_METHOD_TEMPLATES)
325327#define INSTANTIATE_FULL (pointer_type ) \
326328 INSTANTIATE_HALF (pointer_type) \
327329 template class ConfigureLoadStoreFromBuffer <pointer_type>; \
328- template class core ::ConfigureLoadStoreFromBuffer<pointer_type>; \
330+ template class core ::ConfigureLoadStoreFromBuffer<pointer_type>; \
329331 template class compose ::ConfigureLoadStore< \
330332 /* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
331333 ConfigureLoadStoreFromBuffer<pointer_type>>; \
0 commit comments