diff --git a/src/include/ranges/value_range.h b/src/include/ranges/value_range.h index 5557d2d..e999672 100644 --- a/src/include/ranges/value_range.h +++ b/src/include/ranges/value_range.h @@ -109,7 +109,8 @@ namespace MultiArrayTools virtual size_t dim() const final; virtual SpaceType spaceType() const final; - + virtual DataHeader dataHeader() const final; + virtual std::string stringMeta(size_t pos) const final; virtual std::vector data() const final; @@ -355,11 +356,7 @@ namespace MultiArrayTools std::vector ValueRange::data() const { assert(0); - DataHeader h; - h.spaceType = static_cast( SpaceType::NONE ); - h.metaSize = 0; - h.metaType = NumTypeMap::num; - h.multiple = 0; + DataHeader h = dataHeader(); std::vector out; out.reserve(h.metaSize + sizeof(DataHeader)); char* hcp = reinterpret_cast(&h); @@ -369,7 +366,18 @@ namespace MultiArrayTools //out.insert(out.end(), scp, scp + h.metaSize); return out; } - + + template + DataHeader ValueRange::dataHeader() const + { + DataHeader h; + h.spaceType = static_cast( SpaceType::NONE ); + h.metaSize = 0; + h.metaType = NumTypeMap::num; + h.multiple = 0; + return h; + } + template typename ValueRange::IndexType ValueRange::begin() const {