CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
index_format.h
Go to the documentation of this file.
1// -*- C++ -*-
12#ifndef __cxz_index_format_h__
13#define __cxz_index_format_h__
14
15#include "base/base.h"
16#include "xpr/xpr.h"
17
18namespace CNORXZ
19{
23 template <class FormatT> struct is_static_format { CXZ_CVAL_FALSE; };
24
30 template <SizeT N>
31 class MFormat
32 {
33 public:
35
41 explicit constexpr MFormat(const Arr<UPos,N>& b);
42
47 template <class FormatT>
48 constexpr MFormat(const FormatT& f);
49
51 const Arr<UPos,N>& all() const;
52
54 constexpr decltype(auto) size() const;
55
59 template <SizeT I>
60 constexpr decltype(auto) get(CSizeT<I> i) const;
61
65 template <SizeT I>
66 constexpr decltype(auto) operator[](CSizeT<I> i) const;
67
68 private:
69 Arr<UPos,N> mB;
70
71 };
72
77 template <SizeT N> struct is_static_format<MFormat<N>> { CXZ_CVAL_TRUE; };
78
84 template <class... PosT>
86 {
87 public:
88 typedef Tuple<PosT...> InputType;
89
95 explicit constexpr GMFormat(const Tuple<PosT...>& b);
96
100 explicit constexpr GMFormat(Tuple<PosT...>&& b);
101
107 template <class FormatT>
108 constexpr GMFormat(const FormatT& f);
109
111 const Tuple<PosT...>& all() const;
112
114 constexpr decltype(auto) size() const;
115
119 template <SizeT I>
120 constexpr decltype(auto) get(CSizeT<I> i) const;
121
125 template <SizeT I>
126 constexpr decltype(auto) operator[](CSizeT<I> i) const;
127
128 private:
129 Tuple<PosT...> mB;
130 };
131
135 template <class... PosT>
136 constexpr decltype(auto) gmformat(const PosT&... ps);
137
142 template <class... PosT> struct is_static_format<GMFormat<PosT...>> { CXZ_CVAL_TRUE; };
143
149 {
150 public:
152
158 explicit YFormat(const Vector<UPos>& b);
159
163 template <class FormatT>
164 YFormat(const FormatT& f);
165
167 const Vector<UPos>& all() const;
168
170 SizeT size() const;
171
175 template <SizeT I>
176 const UPos& get(CSizeT<I> i) const;
177
181 template <SizeT I>
182 const UPos& operator[](CSizeT<I> i) const;
183
187 const UPos& get(SizeT i) const;
188
192 const UPos& operator[](SizeT i) const;
193
194 private:
195 Vector<UPos> mB;
196 };
197
202 bool formatIsTrivial(const Vector<SizeT>& f, const Vector<SizeT>& s);
203}
204
205#endif
basic headers
constexpr GMFormat(const Tuple< PosT... > &b)
Tuple< PosT... > InputType
constexpr decltype(auto) size() const
SP_DEFAULT_MEMBERS(constexpr, GMFormat)
constexpr decltype(auto) get(CSizeT< I > i) const
const Tuple< PosT... > & all() const
SP_DEFAULT_MEMBERS(constexpr, MFormat)
const Arr< UPos, N > & all() const
Arr< UPos, N > InputType
constexpr MFormat(const Arr< UPos, N > &b)
constexpr decltype(auto) size() const
constexpr decltype(auto) get(CSizeT< I > i) const
DEFAULT_MEMBERS(YFormat)
const UPos & get(CSizeT< I > i) const
YFormat(const Vector< UPos > &b)
const UPos & operator[](CSizeT< I > i) const
const Vector< UPos > & all() const
SizeT size() const
Vector< UPos > InputType
uint64_t SizeT
Definition types.h:38
std::vector< T, Allocator< T > > Vector
Definition types.h:310
std::integral_constant< SizeT, N > CSizeT
Definition types.h:81
Sptr< Range > rangeCast(const RangePtr r)
std::tuple< T... > Tuple
Definition types.h:60
std::array< T, N > Arr
Definition types.h:45
constexpr decltype(auto) gmformat(const PosT &... ps)
bool formatIsTrivial(const Vector< SizeT > &f, const Vector< SizeT > &s)
Xpression main header.