IOLink IOL_v1.8.0_release
Loading...
Searching...
No Matches
Indexer.h
1#pragma once
2
3#include <iolink/DataType.h>
4#include <iolink/MemoryLayout.h>
5#include <iolink/VectorX.h>
6
7namespace iolink
8{
9
35class IOLINK_API Indexer final
36{
37public:
38 Indexer();
39
55 Indexer(const VectorXu64& shape, const VectorXu64& stride, const VectorXu64& layout);
56
73 Indexer(const VectorXu64& shape, const VectorXu64& stride, MemoryLayout standardLayout);
74
85 Indexer(const VectorXu64& shape, const VectorXu64& layout);
86
98 Indexer(const VectorXu64& shape, MemoryLayout standardLayout);
99
111 explicit Indexer(const VectorXu64& shape);
112
122 Indexer(const VectorXu64& shape, DataType dtype);
123
133 Indexer(const VectorXu64& shape, DataType dtype, MemoryLayout standardLayout);
134
144 Indexer(const VectorXu64& shape, DataType dtype, const VectorXu64& byteStride);
145
154 Indexer(const VectorXu64& shape, DataType dtype, const VectorXu64& byteStride, const VectorXu64& layout);
155
156 Indexer(const Indexer& other);
157 Indexer& operator=(const Indexer& other);
158
159 Indexer(Indexer&& other) noexcept;
160 Indexer& operator=(Indexer&& other) noexcept;
161
162 ~Indexer();
163
164 bool operator==(const Indexer& other) const;
165 bool operator!=(const Indexer& other) const;
166
170 size_t dimensionCount() const;
171
175 const VectorXu64& shape() const;
176
181
188 const VectorXu64& stride() const;
189
193 const VectorXu64& byteStride() const;
194
198 const VectorXu64& layout() const;
199
205 size_t shape(size_t index) const;
206
215 size_t stride(size_t index) const;
216
220 size_t byteStride(size_t index) const;
221
227 size_t layout(size_t index) const;
228
232 size_t elementCount() const;
233
240 size_t byteCount() const;
241
250 size_t offset(const VectorXu64& index) const;
251
261 size_t byteOffset(const VectorXu64& index) const;
262
270 bool isContinuous() const;
271
272private:
273 class Private;
274 Private* m_private;
275};
276
277} // end namespace iolink