forgot dataHeader() in ValueRange -> fix

This commit is contained in:
Christian Zimmermann 2018-11-07 13:27:45 +01:00
parent fa1f16a3c8
commit 15388dcdfa

View file

@ -109,6 +109,7 @@ namespace MultiArrayTools
virtual size_t dim() const final; virtual size_t dim() const final;
virtual SpaceType spaceType() const final; virtual SpaceType spaceType() const final;
virtual DataHeader dataHeader() const final;
virtual std::string stringMeta(size_t pos) const final; virtual std::string stringMeta(size_t pos) const final;
virtual std::vector<char> data() const final; virtual std::vector<char> data() const final;
@ -355,11 +356,7 @@ namespace MultiArrayTools
std::vector<char> ValueRange<U>::data() const std::vector<char> ValueRange<U>::data() const
{ {
assert(0); assert(0);
DataHeader h; DataHeader h = dataHeader();
h.spaceType = static_cast<int>( SpaceType::NONE );
h.metaSize = 0;
h.metaType = NumTypeMap<U>::num;
h.multiple = 0;
std::vector<char> out; std::vector<char> out;
out.reserve(h.metaSize + sizeof(DataHeader)); out.reserve(h.metaSize + sizeof(DataHeader));
char* hcp = reinterpret_cast<char*>(&h); char* hcp = reinterpret_cast<char*>(&h);
@ -370,6 +367,17 @@ namespace MultiArrayTools
return out; return out;
} }
template <typename U>
DataHeader ValueRange<U>::dataHeader() const
{
DataHeader h;
h.spaceType = static_cast<int>( SpaceType::NONE );
h.metaSize = 0;
h.metaType = NumTypeMap<U>::num;
h.multiple = 0;
return h;
}
template <typename U> template <typename U>
typename ValueRange<U>::IndexType ValueRange<U>::begin() const typename ValueRange<U>::IndexType ValueRange<U>::begin() const
{ {