Flutter Engine
The Flutter Engine
|
#include <SkRefCnt.h>
Public Member Functions | |
SkRefCntBase () | |
virtual | ~SkRefCntBase () |
bool | unique () const |
void | ref () const |
void | unref () const |
Private Member Functions | |
virtual void | internal_dispose () const |
Friends | |
class | SkWeakRefCnt |
SkRefCntBase is the base class for objects that may be shared by multiple objects. When an existing owner wants to share a reference, it calls ref(). When an owner wants to release its reference, it calls unref(). When the shared object's reference count goes to zero as the result of an unref() call, its (virtual) destructor is called. It is an error for the destructor to be called explicitly (or via the object going out of scope on the stack or calling delete) if getRefCnt() > 1.
Definition at line 31 of file SkRefCnt.h.
|
inline |
Default construct, initializing the reference count to 1.
Definition at line 35 of file SkRefCnt.h.
|
inlinevirtual |
Destruct, asserting that the reference count is 1.
Definition at line 39 of file SkRefCnt.h.
|
inlineprivatevirtual |
Called when the ref count goes to 0.
Definition at line 94 of file SkRefCnt.h.
|
inline |
Increment the reference count. Must be balanced by a call to unref().
Definition at line 62 of file SkRefCnt.h.
|
inline |
May return true if the caller is the only owner. Ensures that all previous owner's actions are complete.
Definition at line 50 of file SkRefCnt.h.
|
inline |
Decrement the reference count. If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.
Definition at line 72 of file SkRefCnt.h.
|
friend |
Definition at line 104 of file SkRefCnt.h.