summaryrefslogtreecommitdiff
path: root/modules/codec
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-04-14 10:47:44 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-04-14 10:47:44 +0200
commita9928c946f475be1c26bbc174a6bd57c0e284562 (patch)
tree0e7a942e489ed549262d86b38804ae9d6d950668 /modules/codec
parent4929dbced501d4252e890872abf8e29b7dcfa0e7 (diff)
downloadforstio-forstio-a9928c946f475be1c26bbc174a6bd57c0e284562.tar.gz
Adding flat_{data,size} functions, preparing to make
internal_{data,size} deprecated
Diffstat (limited to 'modules/codec')
-rw-r--r--modules/codec/c++/data.hpp18
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 {