Ginkgo
Generated from pipelines/1589998975 branch based on develop. Ginkgo version 1.10.0
A numerical linear algebra library targeting many-core architectures
|
This mixin provides a default implementation of a concrete factory. More...
#include <ginkgo/core/base/abstract_factory.hpp>
Public Types | |
using | product_type = ProductType |
using | parameters_type = ParametersType |
using | polymorphic_base = PolymorphicBase |
using | abstract_product_type = typename PolymorphicBase::abstract_product_type |
using | components_type = typename PolymorphicBase::components_type |
Public Types inherited from gko::EnablePolymorphicAssignment< ConcreteFactory > | |
using | result_type = ConcreteFactory |
Public Types inherited from gko::ConvertibleTo< ConcreteFactory > | |
using | result_type = ConcreteFactory |
Public Member Functions | |
template<typename... Args> | |
std::unique_ptr< product_type > | generate (Args &&... args) const |
const parameters_type & | get_parameters () const noexcept |
Returns the parameters of the factory. More... | |
Public Member Functions inherited from gko::EnableAbstractPolymorphicObject< ConcreteFactory, PolymorphicBase > | |
std::unique_ptr< ConcreteFactory > | create_default (std::shared_ptr< const Executor > exec) const |
std::unique_ptr< ConcreteFactory > | create_default () const |
std::unique_ptr< ConcreteFactory > | clone (std::shared_ptr< const Executor > exec) const |
std::unique_ptr< ConcreteFactory > | clone () const |
ConcreteFactory * | copy_from (const PolymorphicObject *other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, ConcreteFactory > * | copy_from (std::unique_ptr< Derived > &&other) |
std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, ConcreteFactory > * | copy_from (const std::unique_ptr< Derived > &other) |
ConcreteFactory * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
ConcreteFactory * | move_from (ptr_param< PolymorphicObject > other) |
ConcreteFactory * | clear () |
Public Member Functions inherited from gko::EnablePolymorphicAssignment< ConcreteFactory > | |
void | convert_to (result_type *result) const override |
Converts the implementer to an object of type result_type. More... | |
void | move_to (result_type *result) override |
Converts the implementer to an object of type result_type by moving data from this object. More... | |
Public Member Functions inherited from gko::ConvertibleTo< ConcreteFactory > | |
void | convert_to (ptr_param< result_type > result) const |
void | move_to (ptr_param< result_type > result) |
Static Public Member Functions | |
static parameters_type | create () |
Creates a new ParametersType object which can be used to instantiate a new ConcreteFactory. More... | |
Friends | |
class | EnablePolymorphicObject< ConcreteFactory, PolymorphicBase > |
This mixin provides a default implementation of a concrete factory.
It implements all the methods of AbstractFactory and PolymorphicObject. Its implementation of the generate_impl() method delegates the creation of the product by calling the ProductType::ProductType(const ConcreteFactory *, const components_type &)
constructor. The factory also supports parameters by using the ParametersType
structure, which is defined by the user.
For a simple example, see IntFactory in core/test/base/abstract_factory.cpp
.
ConcreteFactory | the concrete factory which is being implemented [CRTP parameter] |
ProductType | the concrete type of products which this factory produces, has to be a subclass of PolymorphicBase::abstract_product_type |
ParametersType | a type representing the parameters of the factory, has to inherit from the enable_parameters_type mixin |
PolymorphicBase | parent of ConcreteFactory in the polymorphic hierarchy, has to be a subclass of AbstractFactory |
|
inlinestatic |
Creates a new ParametersType object which can be used to instantiate a new ConcreteFactory.
This method does not construct the factory directly, but returns a new parameters_type object, which can be used to set the parameters of the factory. Once the parameters have been set, the parameters_type::on() method can be used to obtain an instance of the factory with those parameters.
|
inlinenoexcept |
Returns the parameters of the factory.