$darkmode
#include <controller.hpp>
Public Member Functions | |
| virtual std::unique_ptr< ControllerFactory > | clone () const =0 |
| virtual std::unique_ptr< Controller > | make (const fable::Conf &c) const =0 |
Public Member Functions inherited from cloe::ModelFactory | |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
Public Member Functions inherited from cloe::Entity | |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
| const std::string & | name () const |
| void | set_name (std::string name) |
| const std::string & | description () const |
| void | set_description (std::string desc) |
Public Member Functions inherited from fable::Confable | |
| Confable (const Confable &) noexcept | |
| Confable (Confable &&) noexcept=default | |
| Confable & | operator= (const Confable &other) noexcept |
| Confable & | operator= (Confable &&other) noexcept |
| virtual void | reset_schema () |
| Schema & | schema () |
| const Schema & | schema () const |
| virtual void | validate_or_throw (const Conf &c) const |
| virtual bool | validate (const Conf &c, std::optional< SchemaError > &err) const |
| virtual void | from_conf (const Conf &c) |
| virtual void | to_json (Json &j) const |
| Json | to_json () const |
Static Public Attributes | |
| static constexpr char const * | PLUGIN_TYPE = "controller" |
| static constexpr char const * | PLUGIN_API_VERSION = "2.0" |
Additional Inherited Members | |
Protected Member Functions inherited from cloe::Entity | |
| virtual Logger | logger () const |
Protected Member Functions inherited from fable::Confable | |
| virtual Schema | schema_impl () |
Protected Attributes inherited from cloe::Entity | |
| std::string | name_ |
| std::string | desc_ |
A ControllerFactory creates a new Controller and is required for each Controller implementation.
|
pure virtual |
Create a clone of the factory with its current configuration.
This cannot be done from the abstract class, but the implementation in most inheriting classes can be a oneliner:
return std::make_unique<std::decay<decltype(*this)>::type>(*this);
The above one-liner is only required for genericity and is equivalent to:
return std::make_unique<FoobarFactory>(*this);
|
pure virtual |
Create a new Controller based on the current configuration and the given Conf.