26 #ifndef FABLE_SCHEMA_CONFABLE_HPP_ 27 #define FABLE_SCHEMA_CONFABLE_HPP_ 42 template <typename T, std::enable_if_t<std::is_base_of<Confable, T>::value,
int> = 0>
48 schema_ = Type().schema();
50 this->type_ = schema_.
type();
51 this->desc_ = std::move(desc);
56 , schema_(ptr->schema())
58 assert(ptr !=
nullptr);
62 Box get_confable_schema()
const {
return schema_.
clone(); }
67 this->augment_schema(j);
72 if (ptr_ ==
nullptr) {
81 assert(ptr_ !=
nullptr);
86 assert(ptr_ !=
nullptr);
90 Json serialize(
const Type& x)
const {
return x.to_json(); }
92 Type deserialize(
const Conf& c)
const {
105 template <
typename T>
107 assert(ptr !=
nullptr);
114 #endif // FABLE_SCHEMA_CONFABLE_HPP_
void validate(const Conf &c) const override
Definition: confable.hpp:71
Definition: interface.hpp:263
Json json_schema() const override
Definition: confable.hpp:65
nlohmann::json Json
Definition: json.hpp:62
void reset_ptr() override
Definition: interface.hpp:343
void reset_ptr() override
Definition: confable.hpp:98
void from_conf(const Conf &c) override
Definition: confable.hpp:85
void to_json(Json &j) const override
Definition: confable.hpp:80
Definition: confable.hpp:43
virtual Json to_json() const
Definition: interface.hpp:220
Interface * clone() const override
Definition: interface.hpp:332
JsonType type() const override
Definition: interface.hpp:333
void validate(const Conf &c) const override
Definition: interface.hpp:340
Definition: interface.hpp:354
Json json_schema() const override
Definition: interface.hpp:339