enable_parameters_type< ConcreteParametersType, Factory > Class Template Reference

enable_parameters_type&lt; ConcreteParametersType, Factory &gt; Class Template Reference#

Reference API: gko::enable_parameters_type< ConcreteParametersType, Factory > Class Template Reference
Reference API
gko::enable_parameters_type< ConcreteParametersType, Factory > Class Template Reference

#include <ginkgo/core/base/abstract_factory.hpp>

Inheritance diagram for gko::enable_parameters_type< ConcreteParametersType, Factory >:
[legend]

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

template<typename ConcreteParametersType, typename Factory>
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
ConcreteParametersTypethe concrete parameters type which is being implemented [CRTP parameter]
Factorythe concrete factory for which these parameters are being used

Member Function Documentation

◆ on()

template<typename ConcreteParametersType , typename Factory >
std::unique_ptr< Factory > gko::enable_parameters_type< ConcreteParametersType, Factory >::on ( std::shared_ptr< const Executor exec) const
inline

Creates a new factory on the specified executor.

Parameters
execthe 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()

template<typename ConcreteParametersType , typename Factory >
template<typename... Args>
ConcreteParametersType & gko::enable_parameters_type< ConcreteParametersType, Factory >::with_loggers ( Args &&...  _value)
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

template<typename ConcreteParametersType , typename Factory >
std::unordered_map<std::string, std::function<void(std::shared_ptr<const Executor> exec, ConcreteParametersType&)> > gko::enable_parameters_type< ConcreteParametersType, Factory >::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

template<typename ConcreteParametersType , typename Factory >
std::vector<std::shared_ptr<const log::Logger> > gko::enable_parameters_type< ConcreteParametersType, Factory >::loggers {}
protected

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