docs
Loading...
Searching...
No Matches
RefCountedabstract

#include <Ultralight/RefPtr.h>

Overview

Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.

Inheritance diagram for RefCounted:
App Buffer ClipboardData FontFile Foreground ImageSource JSContext LayoutNode Renderer Session String16Vector View WeakRefCounted Window

Public Member Functions

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.

Protected Member Functions

virtual ~RefCounted ()

Constructor & Destructor Documentation

◆ ~RefCounted()

virtual ~RefCounted ( )
protectedvirtual

Member Function Documentation

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