Flutter Engine
The Flutter Engine
|
#include <SkRefCnt.h>
Public Types | |
using | element_type = T |
using | sk_is_trivially_relocatable = std::true_type |
Public Member Functions | |
constexpr | sk_sp () |
constexpr | sk_sp (std::nullptr_t) |
sk_sp (const sk_sp< T > &that) | |
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) | |
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) | |
~sk_sp () | |
sk_sp< T > & | operator= (std::nullptr_t) |
sk_sp< T > & | operator= (const sk_sp< T > &that) |
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) |
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) |
T * | release () |
void | swap (sk_sp< T > &that) |
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.
Definition at line 220 of file SkRefCnt.h.
using sk_sp< T >::sk_is_trivially_relocatable = std::true_type |
Definition at line 335 of file SkRefCnt.h.
Definition at line 224 of file SkRefCnt.h.
Definition at line 225 of file SkRefCnt.h.
Shares the underlying object by calling ref(), so that both the argument and the newly created sk_sp both have a reference to it.
Definition at line 231 of file SkRefCnt.h.
|
inline |
Definition at line 234 of file SkRefCnt.h.
Move the underlying object from the argument to the newly created sk_sp. Afterwards only the new sk_sp will have a reference to the object, and the argument will point to null. No call to ref() or unref() will be made.
Definition at line 241 of file SkRefCnt.h.
|
inline |
Definition at line 244 of file SkRefCnt.h.
Adopt the bare pointer into the newly created sk_sp. No call to ref() or unref() will be made.
Definition at line 250 of file SkRefCnt.h.
Calls unref() on the underlying object pointer.
Definition at line 255 of file SkRefCnt.h.
Definition at line 303 of file SkRefCnt.h.
Definition at line 301 of file SkRefCnt.h.
Definition at line 296 of file SkRefCnt.h.
Definition at line 304 of file SkRefCnt.h.
Shares the underlying object referenced by the argument by calling ref() on it. If this sk_sp previously had a reference to an object (i.e. not null) it will call unref() on that object.
Definition at line 267 of file SkRefCnt.h.
|
inline |
Definition at line 275 of file SkRefCnt.h.
|
inline |
Definition at line 291 of file SkRefCnt.h.
Definition at line 260 of file SkRefCnt.h.
Return the bare pointer, and set the internal object pointer to nullptr. The caller must assume ownership of the object, and manage its reference count directly. No call to unref() will be made.
Definition at line 324 of file SkRefCnt.h.
Adopt the new bare pointer, and call unref() on any previously held object (if not null). No call to ref() will be made.
Definition at line 310 of file SkRefCnt.h.
Definition at line 330 of file SkRefCnt.h.