#pragma once #include #include "schema.h" namespace saw { namespace encode { struct Native {}; } /* * Helper for the basic message container, so the class doesn't have to be * specialized 10 times. */ template struct native_data_type; template <> struct native_data_type> { using type = int8_t; }; template <> struct native_data_type> { using type = int16_t; }; template <> struct native_data_type> { using type = int32_t; }; template <> struct native_data_type> { using type = int64_t; }; template <> struct native_data_type> { using type = uint8_t; }; template <> struct native_data_type> { using type = uint16_t; }; template <> struct native_data_type> { using type = uint32_t; }; template <> struct native_data_type> { using type = uint64_t; }; template <> struct native_data_type> { using type = float; }; template class data { private: static_assert(always_false, "Type not supported"); }; template<> class data { private: std::string value_; public: SAW_FORBID_COPY(data); data(std::string&& value__):value_{std::move(value__)}{} std::size_t size() const { return value_.size(); } bool operator==(const data& data){ return value_ == data.value_; } }; template class data, encode::Native> { private: }; }