@@ -41,15 +41,15 @@ namespace internal
4141} // namespace internal
4242
4343template <typename ChildClass = void >
44- class ConfigureStoreChunk : protected internal ::ConfigureStoreChunkData
44+ class ConfigureLoadStore : protected internal ::ConfigureStoreChunkData
4545{
4646 friend class RecordComponent ;
4747 template <typename >
48- friend class ConfigureStoreChunk ;
48+ friend class ConfigureLoadStore ;
4949
5050protected:
51- ConfigureStoreChunk (RecordComponent &rc);
52- ConfigureStoreChunk (ConfigureStoreChunkData &&);
51+ ConfigureLoadStore (RecordComponent &rc);
52+ ConfigureLoadStore (ConfigureStoreChunkData &&);
5353
5454 auto dim () const -> uint8_t;
5555 auto getOffset () const -> Offset;
@@ -59,7 +59,7 @@ class ConfigureStoreChunk : protected internal::ConfigureStoreChunkData
5959public:
6060 using return_type = std::conditional_t <
6161 std::is_void_v<ChildClass>,
62- /* then*/ ConfigureStoreChunk <void >,
62+ /* then*/ ConfigureLoadStore <void >,
6363 /* else*/ ChildClass>;
6464 template <typename T>
6565 using normalize_dataset_type = std::remove_cv_t <std::remove_extent_t <T>>;
@@ -93,24 +93,24 @@ class ConfigureStoreChunk : protected internal::ConfigureStoreChunkData
9393 typename T_ContiguousContainer::value_type> const >>>;
9494
9595 template <typename T>
96- auto enqueue () -> DynamicMemoryView<T>;
96+ [[nodiscard]] auto enqueueStore () -> DynamicMemoryView<T>;
9797 // definition for this one is in RecordComponent.tpp since it needs the
9898 // definition of class RecordComponent.
9999 template <typename T, typename F>
100- auto enqueue (F &&createBuffer) -> DynamicMemoryView<T>;
100+ [[nodiscard]] auto enqueueStore (F &&createBuffer) -> DynamicMemoryView<T>;
101101};
102102
103103template <typename Ptr_Type>
104104class ConfigureStoreChunkFromBuffer
105- : public ConfigureStoreChunk <ConfigureStoreChunkFromBuffer<Ptr_Type>>
105+ : public ConfigureLoadStore <ConfigureStoreChunkFromBuffer<Ptr_Type>>
106106{
107107public:
108108 using parent_t =
109- ConfigureStoreChunk <ConfigureStoreChunkFromBuffer<Ptr_Type>>;
109+ ConfigureLoadStore <ConfigureStoreChunkFromBuffer<Ptr_Type>>;
110110
111111private:
112112 template <typename T>
113- friend class ConfigureStoreChunk ;
113+ friend class ConfigureLoadStore ;
114114
115115 Ptr_Type m_buffer;
116116 std::optional<MemorySelection> m_mem_select;
@@ -126,80 +126,8 @@ class ConfigureStoreChunkFromBuffer
126126 auto as_parent () & -> parent_t &;
127127 auto as_parent () const & -> parent_t const &;
128128
129- auto enqueue () -> void;
129+ auto enqueueStore () -> void;
130130};
131-
132- template <typename ChildClass>
133- template <typename T>
134- auto ConfigureStoreChunk<ChildClass>::fromSharedPtr(std::shared_ptr<T> data)
135- -> ConfigureStoreChunkFromBuffer<
136- std::shared_ptr<normalize_dataset_type<T> const >>
137- {
138- if (!data)
139- {
140- throw std::runtime_error (
141- " Unallocated pointer passed during chunk store." );
142- }
143- return ConfigureStoreChunkFromBuffer<
144- std::shared_ptr<normalize_dataset_type<T> const >>(
145- std::static_pointer_cast<normalize_dataset_type<T> const >(
146- std::move (data)),
147- {std::move (*this )});
148- }
149- template <typename ChildClass>
150- template <typename T>
151- auto ConfigureStoreChunk<ChildClass>::fromUniquePtr(UniquePtrWithLambda<T> data)
152- -> ConfigureStoreChunkFromBuffer<
153- UniquePtrWithLambda<normalize_dataset_type<T>>>
154- {
155- if (!data)
156- {
157- throw std::runtime_error (
158- " Unallocated pointer passed during chunk store." );
159- }
160- return ConfigureStoreChunkFromBuffer<
161- UniquePtrWithLambda<normalize_dataset_type<T>>>(
162- std::move (data).template static_cast_ <normalize_dataset_type<T>>(),
163- {std::move (*this )});
164- }
165- template <typename ChildClass>
166- template <typename T>
167- auto ConfigureStoreChunk<ChildClass>::fromRawPtr(T *data)
168- -> ConfigureStoreChunkFromBuffer<
169- std::shared_ptr<normalize_dataset_type<T> const >>
170- {
171- if (!data)
172- {
173- throw std::runtime_error (
174- " Unallocated pointer passed during chunk store." );
175- }
176- return ConfigureStoreChunkFromBuffer<
177- std::shared_ptr<normalize_dataset_type<T> const >>(
178- auxiliary::shareRaw (data), {std::move (*this )});
179- }
180-
181- template <typename ChildClass>
182- template <typename T, typename Del>
183- auto ConfigureStoreChunk<ChildClass>::fromUniquePtr(
184- std::unique_ptr<T, Del> data)
185- -> ConfigureStoreChunkFromBuffer<
186- UniquePtrWithLambda<normalize_dataset_type<T>>>
187- {
188- return fromUniquePtr (UniquePtrWithLambda<T>(std::move (data)));
189- }
190- template <typename ChildClass>
191- template <typename T_ContiguousContainer>
192- auto ConfigureStoreChunk<ChildClass>::fromContiguousContainer(
193- T_ContiguousContainer &data) ->
194- typename std::enable_if_t <
195- auxiliary::IsContiguousContainer_v<T_ContiguousContainer>,
196- ConfigureStoreChunkFromBuffer<std::shared_ptr<normalize_dataset_type<
197- typename T_ContiguousContainer::value_type> const >>>
198- {
199- if (!m_extent.has_value () && dim () == 1 )
200- {
201- m_extent = Extent{data.size ()};
202- }
203- return fromRawPtr (data.data ());
204- }
205131} // namespace openPMD
132+
133+ #include " openPMD/LoadStoreChunk.tpp"
0 commit comments