ptr_param< T > Class Template Reference#
|
Reference API
|
#include <ginkgo/core/base/utils_helper.hpp>
Public Member Functions | |
| ptr_param (T *ptr) | |
| template<typename U , std::enable_if_t< std::is_base_of< T, U >::value > * = nullptr> | |
| ptr_param (const std::shared_ptr< U > &ptr) | |
| template<typename U , typename Deleter , std::enable_if_t< std::is_base_of< T, U >::value > * = nullptr> | |
| ptr_param (const std::unique_ptr< U, Deleter > &ptr) | |
| template<typename U , std::enable_if_t< std::is_base_of< T, U >::value > * = nullptr> | |
| ptr_param (const ptr_param< U > &ptr) | |
| ptr_param (const ptr_param &)=default | |
| ptr_param (ptr_param &&)=default | |
| T & | operator* () const |
| T * | operator-> () const |
| T * | get () const |
| operator bool () const | |
| ptr_param & | operator= (const ptr_param &)=delete |
| ptr_param & | operator= (ptr_param &&)=delete |
Detailed Description
class gko::ptr_param< T >
This class is used for function parameters in the place of raw pointers. Pointer parameters should be used for everything that does not involve transfer of ownership. It can be converted to from raw pointers, shared pointers and unique pointers of the specified type or any derived type. This allows functions to be called without having to use gko::lend or calling .get() for every pointer argument. It probably has no use outside of function parameters, as it is immutable.
- Template Parameters
-
T the pointed-to type
Constructor & Destructor Documentation
◆ ptr_param() [1/4]
|
inline |
Initializes the ptr_param from a raw pointer.
◆ ptr_param() [2/4]
|
inline |
Initializes the ptr_param from a shared_ptr.
◆ ptr_param() [3/4]
|
inline |
Initializes the ptr_param from a unique_ptr.
◆ ptr_param() [4/4]
|
inline |
Member Function Documentation
◆ get()
|
inline |
- Returns
- the underlying pointer.
Referenced by gko::LinOp::apply(), gko::LinOp::apply(), gko::LinOp::apply(), gko::LinOp::apply(), gko::solver::ApplyWithInitialGuess::apply_with_initial_guess(), gko::solver::ApplyWithInitialGuess::apply_with_initial_guess(), gko::as(), gko::as(), gko::ConvertibleTo< ResultType >::convert_to(), gko::Executor::copy_from(), gko::matrix::Diagonal< ValueType >::inverse_apply(), gko::PolymorphicObject::move_from(), gko::ConvertibleTo< ResultType >::move_to(), gko::matrix::Diagonal< ValueType >::rapply(), and gko::log::Loggable::remove_logger().
◆ operator bool()
|
inlineexplicit |
- Returns
- true iff the underlying pointer is non-null.
◆ operator*()
|
inline |
- Returns
- a reference to the underlying pointee.
◆ operator->()
|
inline |
- Returns
- the underlying pointer.
The documentation for this class was generated from the following file:
- ginkgo/core/base/utils_helper.hpp
Generated by