CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RefCounter< false > Class Referencefinal

A class that implements a simple interface for reference counting. More...

#include <CeresEngine/Foundation/SmartPtr.hpp>

Public Member Functions

 RefCounter ()=default
 
 RefCounter (const UInt64 initialCount)
 
void increment () noexcept
 Increments the reference counter by one.
 
bool decrement () noexcept
 Decrements the reference counter by one.
 

Private Attributes

UInt64 mCounter = 0
 The object's reference counter.
 

Detailed Description

A class that implements a simple interface for reference counting.

This implementation is NOT thread-safe but is faster than alternatives.

Constructor & Destructor Documentation

◆ RefCounter() [1/2]

CeresEngine::RefCounter< false >::RefCounter ( )
default

◆ RefCounter() [2/2]

CeresEngine::RefCounter< false >::RefCounter ( const UInt64  initialCount)
inlineexplicit

Member Function Documentation

◆ decrement()

bool CeresEngine::RefCounter< false >::decrement ( )
noexcept

Decrements the reference counter by one.

Returns
true if the counter is now 0.

◆ increment()

void CeresEngine::RefCounter< false >::increment ( )
noexcept

Increments the reference counter by one.

Member Data Documentation

◆ mCounter

UInt64 CeresEngine::RefCounter< false >::mCounter = 0
private

The object's reference counter.


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