libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
from::DLUT::DLReferenceCountObject Class Reference

Class for implementing reference counting garbage collection. More...

#include <utility.hpp>

Inheritance diagram for from::DLUT::DLReferenceCountObject:
from::CS::CSFD4SoundIns from::DLUT::dummy_rfco from::GXBS::GXDrawTask

Public Member Functions

virtual void deleter ()
 The deleter method to call when reference count reaches zero.
 
int count () const noexcept
 Get number of references to object.
 
void ref () noexcept
 Increment the object's reference count.
 
void unref ()
 Unreference object; there cannot be more ref() calls than unref() calls.
 

Protected Member Functions

 DLReferenceCountObject () noexcept=default
 Protected DLReferenceCountObject constructor.
 

Friends

template<typename T , typename... Args>
requires std::derived_from<T, DLReferenceCountObject>
auto make_refcounted ()
 

Detailed Description

Class for implementing reference counting garbage collection.

Commonly used in ELDEN RING's codebase.

Note
Instances of DLReferenceCountObject can only be constructed on the heap, using with from::make_refcounted.
Derived classes may override the deleter method.

Constructor & Destructor Documentation

◆ DLReferenceCountObject()

from::DLUT::DLReferenceCountObject::DLReferenceCountObject ( )
protecteddefaultnoexcept

Protected DLReferenceCountObject constructor.

Note
Instances of DLReferenceCountObject can only be constructed on the heap, using with from::make_refcounted.

Member Function Documentation

◆ count()

int from::DLUT::DLReferenceCountObject::count ( ) const
inlinenoexcept

Get number of references to object.

Returns
int reference count

◆ unref()

void from::DLUT::DLReferenceCountObject::unref ( )
inline

Unreference object; there cannot be more ref() calls than unref() calls.

Exceptions
std::runtime_errorbad unref() call

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