docs
Loading...
Searching...
No Matches
WeakRefCountedabstract

#include <Ultralight/RefPtr.h>

Overview

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.

Inheritance diagram for WeakRefCounted:
RefCounted Bitmap

Public Member Functions

virtual WeakControlBlock * weak_control_block () const override=0
 Get the control block used to track weak references to this object (never nullptr).
Public Member Functions inherited from RefCounted
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.

Protected Member Functions

virtual ~WeakRefCounted ()=default
Protected Member Functions inherited from RefCounted
virtual ~RefCounted ()

Constructor & Destructor Documentation

◆ ~WeakRefCounted()

virtual ~WeakRefCounted ( )
protectedvirtualdefault

Member Function Documentation

◆ 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: