enable_parameters_type< ConcreteParametersType, Factory > Class Template Reference#
|
Reference API
|
#include <ginkgo/core/base/abstract_factory.hpp>
Public Types | |
| using | factory = Factory |
Public Member Functions | |
| template<typename... Args> | |
| ConcreteParametersType & | with_loggers (Args &&... _value) |
| std::unique_ptr< Factory > | on (std::shared_ptr< const Executor > exec) const |
Protected Member Functions | |
| ConcreteParametersType * | self () noexcept |
| const ConcreteParametersType * | self () const noexcept |
Protected Attributes | |
| std::vector< std::shared_ptr< const log::Logger > > | loggers {} |
| std::unordered_map< std::string, std::function< void(std::shared_ptr< const Executor > exec, ConcreteParametersType &)> > | deferred_factories |
Detailed Description
class gko::enable_parameters_type< ConcreteParametersType, Factory >
The enable_parameters_type mixin is used to create a base implementation of the factory parameters structure.
It provides only the on() method which can be used to instantiate the factory give the parameters stored in the structure.
- Template Parameters
-
ConcreteParametersType the concrete parameters type which is being implemented [CRTP parameter] Factory the concrete factory for which these parameters are being used
Member Function Documentation
◆ on()
|
inline |
Creates a new factory on the specified executor.
- Parameters
-
exec the executor where the factory will be created
- Returns
- a new factory instance
References gko::enable_parameters_type< ConcreteParametersType, Factory >::deferred_factories, and gko::enable_parameters_type< ConcreteParametersType, Factory >::loggers.
◆ with_loggers()
|
inline |
Provides the loggers to be added to the factory and its generated objects in a fluent interface.
References gko::enable_parameters_type< ConcreteParametersType, Factory >::loggers.
Member Data Documentation
◆ deferred_factories
|
protected |
Deferred factory parameter initialization functions that will be called in on(). Their names usually correspond to the variable names in the parameter type. They will be provided the executor and the parameter object currently being initialized from the generators.
Referenced by gko::enable_parameters_type< ConcreteParametersType, Factory >::on().
◆ loggers
|
protected |
Loggers to be attached to the factory and generated object.
Referenced by gko::enable_parameters_type< ConcreteParametersType, Factory >::on(), and gko::enable_parameters_type< ConcreteParametersType, Factory >::with_loggers().
The documentation for this class was generated from the following file:
- ginkgo/core/base/abstract_factory.hpp
Generated by