diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-04-14 10:47:44 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-04-14 10:47:44 +0200 |
| commit | a9928c946f475be1c26bbc174a6bd57c0e284562 (patch) | |
| tree | 0e7a942e489ed549262d86b38804ae9d6d950668 | |
| parent | 4929dbced501d4252e890872abf8e29b7dcfa0e7 (diff) | |
| download | forstio-forstio-a9928c946f475be1c26bbc174a6bd57c0e284562.tar.gz | |
Adding flat_{data,size} functions, preparing to make
internal_{data,size} deprecated
| -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 { |
