1#ifndef EILE_MIT_WEILE_SERIALIZABLEVALUE_HPP
2#define EILE_MIT_WEILE_SERIALIZABLEVALUE_HPP
7#include "unique_serializable.hpp"
9#include "rapidjson/document.h"
35 if (this->
value != val) {
40 void WriteIntoJson(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator)
const override {
41 json.AddMember(
"value", value_type_helpers::get_json_value<
decltype(
value)>(
value, allocator), allocator);
45 if (json.HasMember(
"value")) {
46 T val = json[
"value"].Get<T>();
A serializable value, used for writing values into json.
Definition serializable_value.hpp:28
T GetValue() const
Definition serializable_value.hpp:32
SerializableValue(T val)
Definition serializable_value.hpp:30
void WriteIntoJson(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Definition serializable_value.hpp:40
T value
Definition serializable_value.hpp:53
void SetValue(T val)
Definition serializable_value.hpp:34
static SerializableValue< T > * FromJson(const rapidjson::Value &json)
Definition serializable_value.hpp:44
Abstract Base Class for a serializable object.
Definition serializable.hpp:17
Contains helper functions for serializing and deserializing instances of SerializableValue.