#include <Ultralight/RefPtr.h>
Interface for ref-counted objects that can additionally be observed via the WeakPtr<> smart pointer.
Types deriving this interface support weak references: a WeakPtr can observe the object's lifetime without owning it. WeakPtr<T> requires T to derive WeakRefCounted; using it with a plain RefCounted type is a compile error.
|
| virtual WeakControlBlock * | weak_control_block () const override=0 |
| | Get the control block used to track weak references to this object (never nullptr).
|
| 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.
|
◆ ~WeakRefCounted()
◆ weak_control_block()
| virtual WeakControlBlock * weak_control_block |
( |
| ) |
const |
|
overridepure virtual |
Get the control block used to track weak references to this object (never nullptr).
Reimplemented from RefCounted.
The documentation for this class was generated from the following file: