#include <Ultralight/RefPtr.h>
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
|
| virtual void | AddRef () const =0 |
| | Increment the reference count (thread-safe).
|
| virtual void | Release () const =0 |
| | Decrement the reference count (thread-safe).
|
| virtual int | ref_count () const =0 |
| | Get the current reference count.
|
| virtual WeakControlBlock * | weak_control_block () const |
| | Get the control block used to track weak references to this object.
|
◆ ~RefCounted()
◆ AddRef()
| virtual void AddRef |
( |
| ) |
const |
|
pure virtual |
Increment the reference count (thread-safe).
◆ ref_count()
| virtual int ref_count |
( |
| ) |
const |
|
pure virtual |
Get the current reference count.
◆ Release()
| virtual void Release |
( |
| ) |
const |
|
pure virtual |
Decrement the reference count (thread-safe).
The object is destroyed when the count reaches zero.
◆ weak_control_block()
| virtual WeakControlBlock * weak_control_block |
( |
| ) |
const |
|
inlinevirtual |
Get the control block used to track weak references to this object.
- Returns
- Returns the control block, or nullptr if the concrete type does not support weak references (only types derived from WeakRefCounted do).
- Note
- This is internal bookkeeping for WeakPtr; you should never need to call it directly.
Reimplemented in WeakRefCounted.
The documentation for this class was generated from the following file: