Ginkgo  Generated from pipelines/1330831941 branch based on master. Ginkgo version 1.8.0
A numerical linear algebra library targeting many-core architectures
Public Member Functions | List of all members
gko::deferred_factory_parameter< FactoryType > Class Template Reference

Represents a factory parameter of factory type that can either initialized by a pre-existing factory or by passing in a factory_parameters object whose .on(exec) will be called to instantiate a factory. More...

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

Inheritance diagram for gko::deferred_factory_parameter< FactoryType >:
[legend]

Public Member Functions

 deferred_factory_parameter ()=default
 Creates an empty deferred factory parameter.
 
 deferred_factory_parameter (std::nullptr_t)
 Creates a deferred factory parameter returning a nullptr.
 
template<typename ConcreteFactoryType , std::enable_if_t< detail::is_pointer_convertible< ConcreteFactoryType, FactoryType >::value > * = nullptr>
 deferred_factory_parameter (std::shared_ptr< ConcreteFactoryType > factory)
 Creates a deferred factory parameter from a preexisting factory with shared ownership.
 
template<typename ConcreteFactoryType , typename Deleter , std::enable_if_t< detail::is_pointer_convertible< ConcreteFactoryType, FactoryType >::value > * = nullptr>
 deferred_factory_parameter (std::unique_ptr< ConcreteFactoryType, Deleter > factory)
 Creates a deferred factory parameter by taking ownership of a preexisting factory with unique ownership.
 
template<typename ParametersType , typename U = decltype(std::declval<ParametersType>().on( std::shared_ptr<const Executor>{})), std::enable_if_t< detail::is_pointer_convertible< typename U::element_type, FactoryType >::value > * = nullptr>
 deferred_factory_parameter (ParametersType parameters)
 Creates a deferred factory parameter object from a factory_parameters-like object. More...
 
std::shared_ptr< FactoryType > on (std::shared_ptr< const Executor > exec) const
 Instantiates the deferred parameter into an actual factory. More...
 
bool is_empty () const
 Returns true iff the parameter is empty.
 

Detailed Description

template<typename FactoryType>
class gko::deferred_factory_parameter< FactoryType >

Represents a factory parameter of factory type that can either initialized by a pre-existing factory or by passing in a factory_parameters object whose .on(exec) will be called to instantiate a factory.

Template Parameters
FactoryTypethe type of factory that can be instantiated from this object.

Constructor & Destructor Documentation

◆ deferred_factory_parameter()

template<typename FactoryType>
template<typename ParametersType , typename U = decltype(std::declval<ParametersType>().on( std::shared_ptr<const Executor>{})), std::enable_if_t< detail::is_pointer_convertible< typename U::element_type, FactoryType >::value > * = nullptr>
gko::deferred_factory_parameter< FactoryType >::deferred_factory_parameter ( ParametersType  parameters)
inline

Creates a deferred factory parameter object from a factory_parameters-like object.

To instantiate the actual factory, the parameter's .on(exec) function will be called.

Member Function Documentation

◆ on()

template<typename FactoryType>
std::shared_ptr<FactoryType> gko::deferred_factory_parameter< FactoryType >::on ( std::shared_ptr< const Executor exec) const
inline

Instantiates the deferred parameter into an actual factory.

This will throw if the deferred factory parameter is empty.


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