From 6099ec04bd0d98b9e75f5b55b1215c94ccf20202 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 11 Mar 2018 00:12:37 +0100 Subject: Add operation to allow users to be added to group WARNING! Lazy implementation everywhere, does not handle out-of-order packets --- include/DataView.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/DataView.hpp') diff --git a/include/DataView.hpp b/include/DataView.hpp index c020f91..0ecf9fb 100644 --- a/include/DataView.hpp +++ b/include/DataView.hpp @@ -1,6 +1,8 @@ #pragma once #include "types.hpp" +#include "Hash.hpp" +#include namespace odhtdb { @@ -9,8 +11,20 @@ namespace odhtdb public: DataView() : data(nullptr), size(0) {} DataView(void *_data, usize _size) : data(_data), size(_size) {} + bool operator == (const DataView &other) 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; } -- cgit v1.2.3