libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
from::DLUT::DLReferenceCountPtr< T > Class Template Reference

A refcounted pointer that models std::shared_ptr<T>. More...

#include <utility.hpp>

Public Member Functions

 DLReferenceCountPtr (std::nullptr_t) noexcept
 Construct a new DLReferenceCountPtr (std::nullopt).
 
template<class U >
requires std::convertible_to<U*, T*>
 DLReferenceCountPtr (U *raw) noexcept
 Construct a new DLReferenceCountPtr (raw pointer).
 
 DLReferenceCountPtr (const DLReferenceCountPtr &other) noexcept
 Construct a new DLReferenceCountPtr object (copy).
 
template<class U >
requires std::convertible_to<U*, T*>
 DLReferenceCountPtr (const DLReferenceCountPtr< U > &other) noexcept
 Construct a new DLReferenceCountPtr object (copy, pointer conversion).
 
 DLReferenceCountPtr (DLReferenceCountPtr &&other) noexcept
 Construct a new DLReferenceCountPtr object (move).
 
template<class U >
requires std::convertible_to<U*, T*>
 DLReferenceCountPtr (DLReferenceCountPtr< U > &&other) noexcept
 Construct a new DLReferenceCountPtr object (move, pointer conversion).
 
template<class U >
requires std::convertible_to<U*, T*>
DLReferenceCountPtroperator= (const DLReferenceCountPtr< U > &other)
 Copy assignment operator.
 
template<class U >
requires std::convertible_to<U*, T*>
DLReferenceCountPtroperator= (DLReferenceCountPtr< U > &&other)
 Move assignment operator.
 
void reset ()
 Reset the owned pointer (and decrement reference count).
 
template<class U >
requires std::convertible_to<U*, T*>
void reset (U *raw)
 Replace the owned pointer (and decrement reference count).
 
void swap (DLReferenceCountPtr &other)
 Swap for DLReferenceCountPtr.
 
T * get () const noexcept
 Get the managed pointer.
 
T & operator* () const noexcept
 Dereference the managed pointer.
 
T * operator-> () const noexcept
 Member access for the managed object.
 
 operator bool () const noexcept
 Check if the managed pointer is not null.
 

Detailed Description

template<typename T>
requires std::derived_from<T, DLReferenceCountObject>
class from::DLUT::DLReferenceCountPtr< T >

A refcounted pointer that models std::shared_ptr<T>.

Use from::make_refcounted to create refcounted objects.

Note
These objects must derive from DLReferenceCountObject.
Template Parameters
Ta class that derives from DLReferenceCountObject

Constructor & Destructor Documentation

◆ DLReferenceCountPtr() [1/5]

template<typename T >
template<class U >
requires std::convertible_to<U*, T*>
from::DLUT::DLReferenceCountPtr< T >::DLReferenceCountPtr ( U raw)
inlineexplicitnoexcept

Construct a new DLReferenceCountPtr (raw pointer).

Template Parameters
Ua class that derives from DLReferenceCountObject and is a common class with T
Parameters
rawthe raw pointer to own and manage

◆ DLReferenceCountPtr() [2/5]

template<typename T >
from::DLUT::DLReferenceCountPtr< T >::DLReferenceCountPtr ( const DLReferenceCountPtr< T > &  other)
inlinenoexcept

Construct a new DLReferenceCountPtr object (copy).

Parameters
other

◆ DLReferenceCountPtr() [3/5]

template<typename T >
template<class U >
requires std::convertible_to<U*, T*>
from::DLUT::DLReferenceCountPtr< T >::DLReferenceCountPtr ( const DLReferenceCountPtr< U > &  other)
inlinenoexcept

Construct a new DLReferenceCountPtr object (copy, pointer conversion).

Template Parameters
Uother class that derives from DLReferenceCountObject and is a common class with T
Parameters
other

◆ DLReferenceCountPtr() [4/5]

template<typename T >
from::DLUT::DLReferenceCountPtr< T >::DLReferenceCountPtr ( DLReferenceCountPtr< T > &&  other)
inlinenoexcept

Construct a new DLReferenceCountPtr object (move).

Does not modify the reference count.

Parameters
other

◆ DLReferenceCountPtr() [5/5]

template<typename T >
template<class U >
requires std::convertible_to<U*, T*>
from::DLUT::DLReferenceCountPtr< T >::DLReferenceCountPtr ( DLReferenceCountPtr< U > &&  other)
inlinenoexcept

Construct a new DLReferenceCountPtr object (move, pointer conversion).

Does not modify the reference count.

Template Parameters
Uanother class that derives from DLReferenceCountObject and is a common class with T
Parameters
other

Member Function Documentation

◆ get()

template<typename T >
T * from::DLUT::DLReferenceCountPtr< T >::get ( ) const
inlinenoexcept

Get the managed pointer.

Returns
T* pointer (may be null)

◆ operator bool()

template<typename T >
from::DLUT::DLReferenceCountPtr< T >::operator bool ( ) const
inlineexplicitnoexcept

Check if the managed pointer is not null.

Returns
bool is not null

◆ operator*()

template<typename T >
T & from::DLUT::DLReferenceCountPtr< T >::operator* ( ) const
inlinenoexcept

Dereference the managed pointer.

Warning
Unchecked, may dereference a nullptr!
Returns
T& reference to the managed object

◆ operator->()

template<typename T >
T * from::DLUT::DLReferenceCountPtr< T >::operator-> ( ) const
inlinenoexcept

Member access for the managed object.

Warning
Unchecked, may dereference a nullptr!

◆ operator=() [1/2]

template<typename T >
template<class U >
requires std::convertible_to<U*, T*>
DLReferenceCountPtr & from::DLUT::DLReferenceCountPtr< T >::operator= ( const DLReferenceCountPtr< U > &  other)
inline

Copy assignment operator.

Template Parameters
Uanother class that derives from DLReferenceCountObject and is a common class with T
Parameters
other

◆ operator=() [2/2]

template<typename T >
template<class U >
requires std::convertible_to<U*, T*>
DLReferenceCountPtr & from::DLUT::DLReferenceCountPtr< T >::operator= ( DLReferenceCountPtr< U > &&  other)
inline

Move assignment operator.

Does not modify the reference count.

Template Parameters
Uanother class that derives from DLReferenceCountObject and is a common class with T
Parameters
other

◆ reset()

template<typename T >
template<class U >
requires std::convertible_to<U*, T*>
void from::DLUT::DLReferenceCountPtr< T >::reset ( U raw)
inline

Replace the owned pointer (and decrement reference count).

Template Parameters
Uanother class that derives from DLReferenceCountObject and is a common class with T
Parameters
rawthe raw pointer to own and manage

◆ swap()

template<typename T >
void from::DLUT::DLReferenceCountPtr< T >::swap ( DLReferenceCountPtr< T > &  other)
inline

Swap for DLReferenceCountPtr.

Parameters
other

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