IOLink  IOL_v1.1.0_release
Indexer.h
1 #pragma once
2 
3 #include <iolink/DataType.h>
4 #include <iolink/MemoryLayout.h>
5 #include <iolink/VectorX.h>
6 
7 namespace iolink
8 {
9 
35 class IOLINK_API Indexer final
36 {
37 public:
38  Indexer();
39 
52  Indexer(const VectorXu64& shape, const VectorXu64& stride, const VectorXu64& layout);
53 
67  Indexer(const VectorXu64& shape, const VectorXu64& stride, MemoryLayout standardLayout);
68 
76  Indexer(const VectorXu64& shape, const VectorXu64& layout);
77 
86  Indexer(const VectorXu64& shape, MemoryLayout standardLayout);
87 
96  explicit Indexer(const VectorXu64& shape);
97 
98  Indexer(const Indexer& other);
99  Indexer& operator=(const Indexer& other);
100 
101  Indexer(Indexer&& other) noexcept;
102  Indexer& operator=(Indexer&& other) noexcept;
103 
104  ~Indexer();
105 
109  size_t dimensionCount() const;
110 
114  const VectorXu64& shape() const;
115 
119  const VectorXu64& stride() const;
120 
124  const VectorXu64& layout() const;
125 
131  size_t shape(size_t index) const;
132 
138  size_t stride(size_t index) const;
139 
145  size_t layout(size_t index) const;
146 
150  size_t elementCount() const;
151 
157  size_t offset(const VectorXu64& index) const;
158 
159 private:
160  class Private;
161  Private* m_private;
162 };
163 
164 } // end namespace iolink