|
| constexpr | sk_sp () |
| |
| constexpr | sk_sp (std::nullptr_t) |
| |
| | sk_sp (const sk_sp< T > &that) |
| | Shares the underlying object by calling ref(), so that both the argument and the newly created sk_sp both have a reference to it. More...
|
| |
| template<typename U , typename = typename std::enable_if<std::is_convertible<U*, T*>::value>::type> |
| | sk_sp (const sk_sp< U > &that) |
| |
| | sk_sp (sk_sp< T > &&that) |
| | Move the underlying object from the argument to the newly created sk_sp. More...
|
| |
| template<typename U , typename = typename std::enable_if<std::is_convertible<U*, T*>::value>::type> |
| | sk_sp (sk_sp< U > &&that) |
| |
| | sk_sp (T *obj) |
| | Adopt the bare pointer into the newly created sk_sp. More...
|
| |
| | ~sk_sp () |
| | Calls unref() on the underlying object pointer. More...
|
| |
| sk_sp< T > & | operator= (std::nullptr_t) |
| |
| sk_sp< T > & | operator= (const sk_sp< T > &that) |
| | Shares the underlying object referenced by the argument by calling ref() on it. More...
|
| |
| template<typename U , typename = typename std::enable_if<std::is_convertible<U*, T*>::value>::type> |
| sk_sp< T > & | operator= (const sk_sp< U > &that) |
| |
| sk_sp< T > & | operator= (sk_sp< T > &&that) |
| | Move the underlying object from the argument to the sk_sp. More...
|
| |
| template<typename U , typename = typename std::enable_if<std::is_convertible<U*, T*>::value>::type> |
| sk_sp< T > & | operator= (sk_sp< U > &&that) |
| |
| T & | operator* () const |
| |
| | operator bool () const |
| |
| T * | get () const |
| |
| T * | operator-> () const |
| |
| void | reset (T *ptr=nullptr) |
| | Adopt the new bare pointer, and call unref() on any previously held object (if not null). More...
|
| |
| T * | release () |
| | Return the bare pointer, and set the internal object pointer to nullptr. More...
|
| |
| void | swap (sk_sp< T > &that) |
| |
template<typename T>
class sk_sp< T >
Shared pointer class to wrap classes that support a ref()/unref() interface.
This can be used for classes inheriting from SkRefCnt, but it also works for other classes that match the interface, but have different internal choices: e.g. the hosted class may have its ref/unref be thread-safe, but that is not assumed/imposed by sk_sp.
Declared with the trivial_abi attribute where supported so that sk_sp and types containing it may be considered as trivially relocatable by the compiler so that destroying-move operations i.e. move constructor followed by destructor can be optimized to memcpy.