#pragma once #include "types.hpp" #include "Hash.hpp" #include #include namespace odhtdb { class DataView { public: DataView() : data(nullptr), size(0) {} DataView(void *_data, usize _size) : data(_data), size(_size) {} bool operator == (const DataView &other) const; bool operator != (const DataView &other) const; std::string toString() const; void *data; usize size; }; struct DataViewHasher { size_t operator()(const DataView &dataView) const { return fnvHash((const unsigned char*)dataView.data, dataView.size); } }; template using DataViewMap = std::unordered_map; }