Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
transformation.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <regex>
4#include <algorithm>
5
6#include <absl/hash/hash.h>
7#include <spdlog/spdlog.h>
8
9#include "transformation.pb.h"
10
11#include "parser.hpp"
12
13namespace dcn
14{
23 template <typename H>
24 inline H AbslHashValue(H h, const Transformation& t) {
25 return H::combine(std::move(h), t.name(), t.sol_src());
26 }
27
28 std::string constructTransformationSolidityCode(const Transformation & transformation);
29}
30
31namespace dcn::parse
32{
37 template<>
38 Result<json> parseToJson(Transformation transformation, use_json_t);
39
44 template<>
45 Result<Transformation> parseFromJson(json json_obj, use_json_t);
46
52 template<>
53 Result<std::string> parseToJson(Transformation transformation, use_protobuf_t);
54
59 template<>
60 Result<Transformation> parseFromJson(std::string json_str, use_protobuf_t);
61
62
67 template<>
68 Result<json> parseToJson(TransformationRecord transformation_record, use_json_t);
69
74 template<>
75 Result<std::string> parseToJson(TransformationRecord transformation_record, use_protobuf_t);
76
81 template<>
82 Result<TransformationRecord> parseFromJson(json json_obj, use_json_t);
83
88 template<>
89 Result<TransformationRecord> parseFromJson(std::string json_str, use_protobuf_t);
90
91}
Definition auth.cpp:4
Result< json > parseToJson(T message, use_json_t)
Converts a T to a JSON object using JSON.
Result< T > parseFromJson(json json, use_json_t)
Converts a JSON string to a T using JSON.
Definition decentralised_art.hpp:29
std::string constructTransformationSolidityCode(const Transformation &transformation)
Definition transformation.cpp:5
H AbslHashValue(H h, const Condition &c)
Combines hash values for a Condition object.
Definition condition.hpp:24
nlohmann::json json
Definition parser.hpp:4