XII Release 0.1.0
Loading...
Searching...
No Matches
xiiRefCountingImpl Class Reference

Copyright (c) Theophilus Eriata. All Rights Reserved. More...

#include <RefCounted.h>

Inheritance diagram for xiiRefCountingImpl:
[legend]

Public Member Functions

 xiiRefCountingImpl ()=default
 Constructor.
 xiiRefCountingImpl (const xiiRefCountingImpl &rhs)
void operator= (const xiiRefCountingImpl &rhs)
xiiUInt32 AddRef () const
 Increments the reference counter. Returns the new reference count.
bool TryAddRef () const
xiiUInt32 ReleaseRef () const
 Decrements the reference counter. Returns the new reference count.ywat.
bool IsReferenced () const
 Returns true if the reference count is greater than 0, false otherwise.
xiiUInt32 GetRefCount () const
 Returns the current reference count.

Detailed Description

Copyright (c) Theophilus Eriata. All Rights Reserved.

Member Function Documentation

◆ TryAddRef()

bool xiiRefCountingImpl::TryAddRef ( ) const
inline

Adds a reference only while the count is nonzero. Never resurrects an object whose last reference was released.

The caller must separately ensure the object's memory remains accessible (for example, with a cache lock also taken by its destructor); this is not a weak pointer by itself.


The documentation for this class was generated from the following file:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Types/RefCounted.h