@@ -41,15 +41,15 @@ namespace internal
41
41
} // namespace internal
42
42
43
43
template <typename ChildClass = void >
44
- class ConfigureStoreChunk : protected internal ::ConfigureStoreChunkData
44
+ class ConfigureLoadStore : protected internal ::ConfigureStoreChunkData
45
45
{
46
46
friend class RecordComponent ;
47
47
template <typename >
48
- friend class ConfigureStoreChunk ;
48
+ friend class ConfigureLoadStore ;
49
49
50
50
protected:
51
- ConfigureStoreChunk (RecordComponent &rc);
52
- ConfigureStoreChunk (ConfigureStoreChunkData &&);
51
+ ConfigureLoadStore (RecordComponent &rc);
52
+ ConfigureLoadStore (ConfigureStoreChunkData &&);
53
53
54
54
auto dim () const -> uint8_t;
55
55
auto getOffset () const -> Offset;
@@ -59,7 +59,7 @@ class ConfigureStoreChunk : protected internal::ConfigureStoreChunkData
59
59
public:
60
60
using return_type = std::conditional_t <
61
61
std::is_void_v<ChildClass>,
62
- /* then*/ ConfigureStoreChunk <void >,
62
+ /* then*/ ConfigureLoadStore <void >,
63
63
/* else*/ ChildClass>;
64
64
template <typename T>
65
65
using normalize_dataset_type = std::remove_cv_t <std::remove_extent_t <T>>;
@@ -93,24 +93,24 @@ class ConfigureStoreChunk : protected internal::ConfigureStoreChunkData
93
93
typename T_ContiguousContainer::value_type> const >>>;
94
94
95
95
template <typename T>
96
- auto enqueue () -> DynamicMemoryView<T>;
96
+ [[nodiscard]] auto enqueueStore () -> DynamicMemoryView<T>;
97
97
// definition for this one is in RecordComponent.tpp since it needs the
98
98
// definition of class RecordComponent.
99
99
template <typename T, typename F>
100
- auto enqueue (F &&createBuffer) -> DynamicMemoryView<T>;
100
+ [[nodiscard]] auto enqueueStore (F &&createBuffer) -> DynamicMemoryView<T>;
101
101
};
102
102
103
103
template <typename Ptr_Type>
104
104
class ConfigureStoreChunkFromBuffer
105
- : public ConfigureStoreChunk <ConfigureStoreChunkFromBuffer<Ptr_Type>>
105
+ : public ConfigureLoadStore <ConfigureStoreChunkFromBuffer<Ptr_Type>>
106
106
{
107
107
public:
108
108
using parent_t =
109
- ConfigureStoreChunk <ConfigureStoreChunkFromBuffer<Ptr_Type>>;
109
+ ConfigureLoadStore <ConfigureStoreChunkFromBuffer<Ptr_Type>>;
110
110
111
111
private:
112
112
template <typename T>
113
- friend class ConfigureStoreChunk ;
113
+ friend class ConfigureLoadStore ;
114
114
115
115
Ptr_Type m_buffer;
116
116
std::optional<MemorySelection> m_mem_select;
@@ -126,80 +126,8 @@ class ConfigureStoreChunkFromBuffer
126
126
auto as_parent () & -> parent_t &;
127
127
auto as_parent () const & -> parent_t const &;
128
128
129
- auto enqueue () -> void;
129
+ auto enqueueStore () -> void;
130
130
};
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
- }
205
131
} // namespace openPMD
132
+
133
+ #include " openPMD/LoadStoreChunk.tpp"
0 commit comments