This mixin is used to enable a default Cloneable::clone() implementation and similar for objects that have implemented copy and move constructors.
More...
#include <ginkgo/core/base/polymorphic_object.hpp>
|
|
using | result_type = ConcreteType |
| |
|
using | result_type = ConcreteType |
| |
|
| std::unique_ptr< ConcreteType > | clone (std::shared_ptr< const Executor > exec) const |
| | Creates a clone of the object. More...
|
| |
| std::unique_ptr< ConcreteType > | clone () const |
| | Creates a clone of the object. More...
|
| |
| 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...
|
| |
|
std::unique_ptr< ConcreteType > | create_default () const |
| |
|
std::unique_ptr< ConcreteType > | create_default (std::shared_ptr< const Executor > exec) const |
| |
|
void | convert_to (ptr_param< result_type > result) const |
| |
|
void | move_to (ptr_param< result_type > result) |
| |
|
std::unique_ptr< Cloneable > | clone (std::shared_ptr< const Executor > exec) const |
| |
|
std::unique_ptr< Cloneable > | clone () const |
| |
|
Cloneable * | copy_from (ptr_param< const Cloneable > other) |
| |
|
Cloneable * | move_from (ptr_param< Cloneable > other) |
| |
|
std::unique_ptr< Cloneable > | create_default (std::shared_ptr< const Executor > exec) const |
| |
|
std::unique_ptr< Cloneable > | create_default () const |
| |
template<typename ConcreteType>
class gko::EnableCloneable< ConcreteType >
This mixin is used to enable a default Cloneable::clone() implementation and similar for objects that have implemented copy and move constructors.
- Note
- The ConcreteType must have public constructors, or this class as a friend class.
- Template Parameters
-
| ConcreteType | the concrete type from which the copy_from is being enabled [CRTP parameter] |
◆ clone() [1/2]
template<typename ConcreteType>
Creates a clone of the object.
This is a shorthand for clone(std::shared_ptr<const Executor>) that uses the executor of this object to construct the new object.
- Returns
- A clone of the LinOp.
◆ clone() [2/2]
template<typename ConcreteType>
Creates a clone of the object.
This is the polymorphic equivalent of the executor copy constructor decltype(*this)(exec, this).
- Parameters
-
| exec | the executor where the clone will be created |
- Returns
- A clone of the LinOp.
◆ convert_to()
template<typename ConcreteType>
Converts the implementer to an object of type result_type.
- Parameters
-
| result | the object used to store the result of the conversion |
Implements gko::ConvertibleTo< ConcreteType >.
◆ move_to()
template<typename ConcreteType>
Converts the implementer to an object of type result_type by moving data from this object.
This method is used when the implementer is a temporary object, and move semantics can be used.
- Parameters
-
| result | the object used to emplace the result of the conversion |
- Note
- ConvertibleTo::move_to can be implemented by simply calling ConvertibleTo::convert_to. However, this operation can often be optimized by exploiting the fact that implementer's data can be moved to the result.
Implements gko::ConvertibleTo< ConcreteType >.
The documentation for this class was generated from the following file: