32 #define CONFABLE_FRIENDS(xType) \
33 using ::fable::Confable::to_json; \
34 friend void to_json(::fable::Json& j, const xType& t) { t.to_json(j); } \
35 friend void from_json(const ::fable::Json& j, xType& t) { t.from_conf(::fable::Conf{j}); }
37 #define CONFABLE_SCHEMA(xType) \
38 CONFABLE_FRIENDS(xType) \
39 ::fable::Schema schema_impl() override
106 virtual ~
Confable() noexcept =
default;
159 virtual bool validate(
const Conf& c, std::optional<SchemaError>& err)
const;
196 mutable std::unique_ptr<Schema> schema_;
204 struct adl_serializer<fable::Confable> {
Definition: confable.hpp:98
virtual bool validate(const Conf &c, std::optional< SchemaError > &err) const
Definition: confable.cpp:66
virtual void from_conf(const Conf &c)
Definition: confable.cpp:70
virtual void reset_schema()
Definition: confable.cpp:54
virtual void validate_or_throw(const Conf &c) const
Definition: confable.cpp:58
virtual Schema schema_impl()
Definition: confable.cpp:84
Json to_json() const
Definition: confable.cpp:78
Schema & schema()
Definition: confable.cpp:47
Definition: schema.hpp:173
nlohmann::json Json
Definition: fable_fwd.hpp:35