diff options
Diffstat (limited to 'modules/codec')
| -rw-r--r-- | modules/codec/c++/data.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index 3aab554..a86598a 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -789,6 +789,24 @@ class data<schema::Array<T,Dim>, encode::Native> { return &value_[0u]; } + /** + * + */ + data<schema::UInt64, encode::Native> flat_size() const { + return {value_.size()}; + } + + /** + * Available for contiguous encodings + */ + data<T, encode::Native>* flat_data() { + if(value_.size() == 0u){ + return nullptr; + } + return &value_[0u]; + } + + private: template<typename U> uint64_t get_flat_index(const U& i) const { |
