summaryrefslogtreecommitdiff
path: root/forstio/codec/data.h
diff options
context:
space:
mode:
authorClaudius Holeksa <mail@keldu.de>2023-05-03 20:34:02 +0200
committerClaudius Holeksa <mail@keldu.de>2023-05-03 20:34:02 +0200
commit2aa2af0007b7e969845642027c635cd3fd9c8aea (patch)
treee72a05a3c2bfe58442b160c0c8e98ce1d095f36f /forstio/codec/data.h
parent9b81a2585142260f89d47cbe1e592cec9e1f778f (diff)
Moved dirs and added codec-json dir
Diffstat (limited to 'forstio/codec/data.h')
-rw-r--r--forstio/codec/data.h89
1 files changed, 0 insertions, 89 deletions
diff --git a/forstio/codec/data.h b/forstio/codec/data.h
deleted file mode 100644
index 1682ae7..0000000
--- a/forstio/codec/data.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#pragma once
-
-#include <forstio/core/common.h>
-#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 <class T> struct native_data_type;
-
-template <>
-struct native_data_type<schema::Primitive<schema::SignedInteger, 1>> {
- using type = int8_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::SignedInteger, 2>> {
- using type = int16_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::SignedInteger, 4>> {
- using type = int32_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::SignedInteger, 8>> {
- using type = int64_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::UnsignedInteger, 1>> {
- using type = uint8_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::UnsignedInteger, 2>> {
- using type = uint16_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::UnsignedInteger, 4>> {
- using type = uint32_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::UnsignedInteger, 8>> {
- using type = uint64_t;
-};
-
-template <>
-struct native_data_type<schema::Primitive<schema::FloatingPoint, 4>> {
- using type = float;
-};
-
-template<typename T, typename Encoding = encode::Native>
-class data {
-private:
- static_assert(always_false<T>, "Type not supported");
-};
-
-template<>
-class data<schema::String, encode::Native> {
-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<schema::String, encode::Native>& data){
- return value_ == data.value_;
- }
-};
-
-template<typename T, size_t N>
-class data<schema::Primitive<T,N>, encode::Native> {
-private:
-};
-}