|
|
| DistributionFactory (DistributionPtr *ptr, std::string desc) |
| |
|
| Factory (const Factory< DistributionPtr > &other)=default |
| |
|
| Factory (Factory< DistributionPtr > &&other) noexcept=default |
| |
|
| Factory (Type *ptr, std::string desc) |
| |
|
| Factory (Type *ptr, std::string desc, FactoryMap &&fs) |
| |
|
| Factory (Type *ptr, std::string desc, FactoryPairList fs) |
| |
|
Factory< DistributionPtr > & | operator= (const Factory< DistributionPtr > &other)=default |
| |
|
Factory< DistributionPtr > & | operator= (Factory< DistributionPtr > &&other) noexcept=default |
| |
| void | from_conf (const Conf &c) override |
| |
| void | to_json (Json &j) const override |
| |
| void | reset_ptr () override |
| |
| | FactoryBase (std::string desc="") |
| |
|
| FactoryBase (std::string desc, FactoryPairList fs) |
| |
|
| FactoryBase (std::string desc, FactoryMap &&fs) |
| |
| CRTP | factory_key (const std::string &keyword) && |
| |
| CRTP | args_key (const std::string &keyword) && |
| |
| CRTP | args_subset (bool value) && |
| |
| CRTP | transform_schema (TransformFunc f) && |
| |
| void | set_factory_key (const std::string &keyword) |
| |
| void | set_args_key (const std::string &keyword) |
| |
| void | set_args_subset (bool value) |
| |
| void | set_transform_schema (TransformFunc f) |
| |
| const TypeFactory & | get_factory (const std::string &key) const |
| |
| std::vector< std::string > | get_factory_keys () const |
| |
| bool | has_factory (const std::string &key) const |
| |
| bool | add_factory (const std::string &key, Box &&s, MakeFunc f) |
| |
| void | set_factory (const std::string &key, Box &&s, MakeFunc f) |
| |
| template<typename F , std::enable_if_t<(std::is_default_constructible_v< F > &&std::is_convertible_v< std::unique_ptr< F >, T >), int > = 0> |
| void | add_default_factory (const std::string &key) |
| |
| Json | json_schema () const override |
| |
| bool | validate (const Conf &c, std::optional< SchemaError > &err) const override |
| |
|
Type | make (const Conf &c) const |
| |
|
Type | deserialize (const Conf &c) const |
| |
|
Json | serialize (const Type &x) const |
| |
|
void | serialize_into (Json &j, const Type &x) const |
| |
|
void | deserialize_into (const Conf &c, Type &x) const |
| |
| virtual Json | to_json () const |
| |
| virtual void | to_json (Json &) const=0 |
| |
| std::unique_ptr< Interface > | clone () const override |
| |
|
| operator Box () const |
| |
| JsonType | type () const override |
| |
| std::string | type_string () const override |
| |
| Json | usage () const override |
| |
| bool | is_required () const override |
| |
|
CRTP | require () && |
| |
|
CRTP | required (bool value) && |
| |
|
CRTP | reset_pointer () && |
| |
|
bool | has_description () const |
| |
| void | set_description (std::string s) override |
| |
| const std::string & | description () const override |
| |
|
CRTP | description (std::string desc) && |
| |
| virtual bool | is_variant () const |
| |
| virtual void | validate_or_throw (const Conf &c) const final |
| |
| virtual std::optional< SchemaError > | fail (const Conf &c) const final |
| |
| virtual bool | is_valid (const Conf &c) const final |
| |
| virtual Json | to_json () const |
| |
|
|
using | Type = typename FactoryBase< DistributionPtr, Factory< DistributionPtr > >::Type |
| |
|
using | MakeFunc = typename FactoryBase< DistributionPtr, Factory< DistributionPtr > >::MakeFunc |
| |
|
using | TypeFactory = typename FactoryBase< DistributionPtr, Factory< DistributionPtr > >::TypeFactory |
| |
|
using | FactoryMap = typename FactoryBase< DistributionPtr, Factory< DistributionPtr > >::FactoryMap |
| |
|
using | FactoryPairList = typename FactoryBase< DistributionPtr, Factory< DistributionPtr > >::FactoryPairList |
| |
|
using | Type = T |
| |
|
using | MakeFunc = std::function< T(const Conf &c)> |
| |
|
using | TransformFunc = std::function< Box(Struct &&)> |
| |
|
using | FactoryMap = std::map< std::string, TypeFactory > |
| |
|
using | FactoryPairList = std::initializer_list< std::pair< std::string, TypeFactory > > |
| |
|
| FactoryBase (const FactoryBase &other) |
| |
|
FactoryBase & | operator= (const FactoryBase &other) |
| |
|
| FactoryBase (FactoryBase &&) noexcept=default |
| |
|
FactoryBase & | operator= (FactoryBase &&) noexcept=default |
| |
|
void | reset_schema () |
| |
|
std::vector< Box > | factory_schemas () const |
| |
|
std::vector< Json > | factory_json_schemas () const |
| |
|
| Base (const Base< CRTP > &)=default |
| |
|
| Base (Base< CRTP > &&) noexcept=default |
| |
|
Base< CRTP > & | operator= (const Base< CRTP > &)=default |
| |
|
Base< CRTP > & | operator= (Base< CRTP > &&) noexcept=default |
| |
|
| Base (JsonType t, std::string desc) |
| |
|
| Base (JsonType t) |
| |
|
| Base (std::string desc) |
| |
| bool | validate_type (const Conf &c, std::optional< SchemaError > &err) const |
| |
|
template<typename... Args> |
| SchemaError | error (const Conf &c, std::string_view format, Args &&... args) const |
| |
|
SchemaError | error (const ConfError &e) const |
| |
|
SchemaError | wrong_type (const Conf &c) const |
| |
|
template<typename... Args> |
| bool | set_error (std::optional< SchemaError > &err, const Conf &c, std::string_view format, Args &&... args) const |
| |
|
bool | set_error (std::optional< SchemaError > &err, const ConfError &e) const |
| |
|
bool | set_error (std::optional< SchemaError > &err, SchemaError &&e) const |
| |
|
bool | set_wrong_type (std::optional< SchemaError > &err, const Conf &c) const |
| |
|
void | augment_schema (Json &j) const |
| |
|
| Interface (const Interface &)=default |
| |
|
| Interface (Interface &&) noexcept=default |
| |
|
Interface & | operator= (const Interface &)=default |
| |
|
Interface & | operator= (Interface &&) noexcept=default |
| |
|
std::unique_ptr< Variant > | schema_ |
| |
|
TransformFunc | transform_func_ |
| |
|
FactoryMap | available_ |
| |
|
std::string | factory_key_ {"factory"} |
| |
|
std::string | args_key_ {"args"} |
| |
|
bool | args_subset_ {true} |
| |
|
JsonType | type_ {JsonType::null} |
| |
|
bool | required_ {false} |
| |
|
std::string | desc_ {} |
| |