diff options
author | Claudius 'keldu' Holeksa <mail@keldu.de> | 2024-08-20 15:25:26 +0200 |
---|---|---|
committer | Claudius 'keldu' Holeksa <mail@keldu.de> | 2024-08-20 15:25:26 +0200 |
commit | d22f18470f9b0b44b70f799283de60ab4ccc3a58 (patch) | |
tree | 36cd09a79fb5968d319b20eeab233dddff1b0919 /modules/codec/c++/data_raw.hpp | |
parent | f0bc36c49adee797f9b89b41b6e12f6a2137b499 (diff) |
Raw Data
Diffstat (limited to 'modules/codec/c++/data_raw.hpp')
-rw-r--r-- | modules/codec/c++/data_raw.hpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/modules/codec/c++/data_raw.hpp b/modules/codec/c++/data_raw.hpp index 3081423..40751a3 100644 --- a/modules/codec/c++/data_raw.hpp +++ b/modules/codec/c++/data_raw.hpp @@ -9,6 +9,21 @@ struct NativeRaw { }; } +template<typename T> +struct raw_native_array_type_helper { + using type = data<T,encode::NativeRaw>; +}; + +template<typename T, uint64_t N> +struct raw_native_array_type_helper<schema::Primitive<T,N>> { + using Type = typename native_data_type<schema::Primitive<T,N>>::type; +}; + +template<typename T, typename S> +struct raw_native_array_type_helper<schema::MixedPrecision<T,S>> { + using Type = typename native_data_type<typename schema::MixedPrecision<T,S>::StorageSchema>::type; +}; + template<> class data<schema::Void, encode::NativeRaw> { public: @@ -321,13 +336,18 @@ class data<schema::Array<T,Dim>, encode::NativeRaw, storage::Default> { public: using Schema = schema::Array<T,Dim>; using MetaSchema = typename meta_schema<Schema>::MetaSchema; + + using DataType = std::conditional< + is_primitive<typename T>::value, + typename native_data_type<T>::type + >; private: // data<schema::FixedArray<schema::UInt64, Dim>> dims_; std::array<uint64_t, Dim> dims_; std::vector< std::conditional< is_primitive<Schema>::value, - typename native_data_type<Schema>::type, + typename native_data_type<T>::type, data<T, encode::NativeRaw, storage::Default> > > value_; |