summaryrefslogtreecommitdiff
path: root/forstio/codec/proto_kel.h
diff options
context:
space:
mode:
authorClaudius Holeksa <mail@keldu.de>2023-05-03 19:06:22 +0200
committerClaudius Holeksa <mail@keldu.de>2023-05-03 19:06:22 +0200
commit2e5932edbda07d5b142df95cfe79268ea7fb997b (patch)
tree6278b5bf7ea3ddc2dc84517cc6556c231adf3bb9 /forstio/codec/proto_kel.h
parent995ad27b18e843059bdeb41d26d0eb1c5dffd139 (diff)
changing approach to storage
Diffstat (limited to 'forstio/codec/proto_kel.h')
-rw-r--r--forstio/codec/proto_kel.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/forstio/codec/proto_kel.h b/forstio/codec/proto_kel.h
new file mode 100644
index 0000000..c28f7d6
--- /dev/null
+++ b/forstio/codec/proto_kel.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "data.h"
+
+#include <forstio/core/error.h>
+
+namespace saw {
+namespace encode {
+struct ProtoKel {};
+}
+
+template<typename Schema>
+class data<Schema, encode::ProtoKel> {
+private:
+ own<buffer> buffer_;
+public:
+ data(own<buffer>&& buffer__):buffer_{std::move(buffer__)}{}
+
+ buffer& get_buffer(){
+ return *buffer_;
+ }
+
+ const buffer& get_buffer() const {
+ return *buffer_;
+ }
+};
+
+template<typename Schema>
+class codec<Schema, encode::ProtoKel> {
+private:
+public:
+ error_or<data<Schema, encode::Native>> decode(const data<Schema, encode::ProtoKel>& encoded){
+ return make_error<err::critical>();
+ }
+
+ error_or<data<Schema, encode::ProtoKel>> encode(const data<Schema, encode::Native>& native){
+ return make_error<err::critical>();
+ }
+};
+}
+}