#include <SkRefCnt.h>
Public Member Functions | |
SkAutoUnref (SkRefCnt *obj) | |
~SkAutoUnref () | |
SkRefCnt * | get () const |
bool | ref () |
bool | unref () |
SkRefCnt * | detach () |
SkAutoUnref is a stack-helper class that will automatically call unref() on the object it points to when the SkAutoUnref object goes out of scope. If obj is null, do nothing.
Definition at line 94 of file SkRefCnt.h.
SkAutoUnref::SkAutoUnref | ( | SkRefCnt * | obj | ) | [inline] |
Definition at line 96 of file SkRefCnt.h.
SkAutoUnref::~SkAutoUnref | ( | ) |
SkRefCnt* SkAutoUnref::detach | ( | ) |
If the hosted object is null, do nothing and return NULL, else call unref() on it, set its reference to null, and return the object
SkRefCnt* SkAutoUnref::get | ( | ) | const [inline] |
Definition at line 99 of file SkRefCnt.h.
bool SkAutoUnref::ref | ( | ) |
If the hosted object is null, do nothing and return false, else call ref() on it and return true
bool SkAutoUnref::unref | ( | ) |
If the hosted object is null, do nothing and return false, else call unref() on it, set its reference to null, and return true