$darkmode
cloe::ControllerFactory Class Referenceabstract

#include <controller.hpp>

Inheritance diagram for cloe::ControllerFactory:
Collaboration diagram for cloe::ControllerFactory:

Public Member Functions

virtual std::unique_ptr< ControllerFactoryclone () const =0
 
virtual std::unique_ptr< Controllermake (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
 
Confableoperator= (const Confable &other) noexcept
 
Confableoperator= (Confable &&other) noexcept
 
virtual void reset_schema ()
 
Schemaschema ()
 
const Schemaschema () 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_
 

Detailed Description

A ControllerFactory creates a new Controller and is required for each Controller implementation.

Member Function Documentation

◆ clone()

virtual std::unique_ptr<ControllerFactory> cloe::ControllerFactory::clone ( ) const
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);

◆ make()

virtual std::unique_ptr<Controller> cloe::ControllerFactory::make ( const fable::Conf c) const
pure virtual

Create a new Controller based on the current configuration and the given Conf.

  • This method may throw Error.

The documentation for this class was generated from the following file: