Urho3D
Public Member Functions | Private Attributes | List of all members
Dviglo::RefCounted Class Reference

Base class for intrusively reference-counted objects. These are noncopyable and non-assignable. More...

#include </home/runner/work/Dviglo/Dviglo/DvigloRepository/Source/Urho3D/Container/RefCounted.h>

Inheritance diagram for Dviglo::RefCounted:
Dviglo::AnimationState Dviglo::AttributeAccessor Dviglo::BackgroundLoader Dviglo::CollisionGeometryData Dviglo::Context Dviglo::EventReceiverGroup Dviglo::FontFace Dviglo::HttpRequest Dviglo::Object Dviglo::ObjectFactory Dviglo::Pass Dviglo::PropertySet2D Dviglo::RenderPath Dviglo::RenderSurface Dviglo::ShaderProgram Dviglo::ShaderVariation Dviglo::SoundStream Dviglo::Tile2D Dviglo::TileMapObject2D Dviglo::TmxLayer2D Dviglo::ValueAnimationInfo Dviglo::WorkItem

Public Member Functions

 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
void AddRef ()
 
void ReleaseRef ()
 
int Refs () const
 
int WeakRefs () const
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 

Private Attributes

RefCountrefCount_
 Pointer to the reference count structure.
 

Detailed Description

Base class for intrusively reference-counted objects. These are noncopyable and non-assignable.

Member Function Documentation

◆ AddRef()

void Dviglo::RefCounted::AddRef ( )

Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.

◆ Refs()

int Dviglo::RefCounted::Refs ( ) const

Return reference count.

◆ ReleaseRef()

void Dviglo::RefCounted::ReleaseRef ( )

Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.

◆ WeakRefs()

int Dviglo::RefCounted::WeakRefs ( ) const

Return weak reference count.


The documentation for this class was generated from the following files: