|
|
PolymorphicObject & | operator= (const PolymorphicObject &) |
| std::unique_ptr< PolymorphicObject > | create_default (std::shared_ptr< const Executor > exec) const |
| | Creates a new "default" object of the same dynamic type as this object.
|
| std::unique_ptr< PolymorphicObject > | create_default () const |
| | Creates a new "default" object of the same dynamic type as this object.
|
| std::unique_ptr< PolymorphicObject > | clone (std::shared_ptr< const Executor > exec) const |
| | Creates a clone of the object.
|
| std::unique_ptr< PolymorphicObject > | clone () const |
| | Creates a clone of the object.
|
| PolymorphicObject * | copy_from (const PolymorphicObject *other) |
| | Copies another object into this object.
|
| template<typename Derived, typename Deleter> |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * | copy_from (std::unique_ptr< Derived, Deleter > &&other) |
| | Moves another object into this object.
|
| template<typename Derived, typename Deleter> |
| std::enable_if_t< std::is_base_of< PolymorphicObject, std::decay_t< Derived > >::value, PolymorphicObject > * | copy_from (const std::unique_ptr< Derived, Deleter > &other) |
| | Copies another object into this object.
|
| PolymorphicObject * | copy_from (const std::shared_ptr< const PolymorphicObject > &other) |
| | Copies another object into this object.
|
| PolymorphicObject * | move_from (ptr_param< PolymorphicObject > other) |
| | Moves another object into this object.
|
| PolymorphicObject * | clear () |
| | Transforms the object into its default state.
|
| std::shared_ptr< const Executor > | get_executor () const noexcept |
| | Returns the Executor of the object.
|
| void | add_logger (std::shared_ptr< const Logger > logger) override |
| | Adds a new logger to the list of subscribed loggers.
|
| void | remove_logger (const Logger *logger) override |
| | Removes a logger from the list of subscribed loggers.
|
| const std::vector< std::shared_ptr< const Logger > > & | get_loggers () const override |
| | Returns the vector containing all loggers registered at this object.
|
| void | clear_loggers () override |
| | Remove all loggers registered at this object.
|
|
void | remove_logger (ptr_param< const Logger > logger) |
A PolymorphicObject is the abstract base for all "heavy" objects in Ginkgo that behave polymorphically.
It defines the basic utilities (copying moving, cloning, clearing the objects) for all such objects. It takes into account that these objects are dynamically allocated, managed by smart pointers, and used polymorphically. Additionally, it assumes their data can be allocated on different executors, and that they can be copied between those executors.
- Note
- Most of the public methods of this class should not be overridden directly, and are thus not virtual. Instead, there are equivalent protected methods (ending in <method_name>_impl) that should be overridden instead. This allows polymorphic objects to implement default behavior around virtual methods (parameter checking, type casting).
- See also
- EnablePolymorphicObject if you wish to implement a concrete polymorphic object and have sensible defaults generated automatically. EnableAbstractPolymorphicObject if you wish to implement a new abstract polymorphic object, and have the return types of the methods updated to your type (instead of having them return PolymorphicObject).