5#ifndef DCPP_I_IREFERENCE_COUNTED_HPP_INCLUDED
6#define DCPP_I_IREFERENCE_COUNTED_HPP_INCLUDED
8#include <duckcpp/core/engine/dcpp_types.hpp>
10#ifdef _DCPP_COMPILE_WITH_LEAK_HUNTER_
11 #include <duckcpp/core/engine/leakHunter.hpp>
51 : DebugName(0), ReferenceCounter(1)
53#ifdef _DCPP_COMPILE_WITH_LEAK_HUNTER_
54 LeakHunter::addObject(
this);
61 #ifdef _DCPP_COMPILE_WITH_LEAK_HUNTER_
62 LeakHunter::removeObject(
this);
96 void grab()
const { ++ReferenceCounter; }
129 DCPP_DEBUG_BREAK_IF(ReferenceCounter <= 0)
132 if (!ReferenceCounter)
145 return ReferenceCounter;
174 mutable i32 ReferenceCounter;
Base class of most objects of the Duckcpp Engine.
Definition IReferenceCounted.hpp:46
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.hpp:126
void setDebugName(const c8 *newName)
Sets the debug name of the object.
Definition IReferenceCounted.hpp:163
IReferenceCounted()
Constructor.
Definition IReferenceCounted.hpp:50
const c8 * getDebugName() const
Returns the debug name of the object.
Definition IReferenceCounted.hpp:152
i32 getReferenceCount() const
Get the reference count.
Definition IReferenceCounted.hpp:143
void grab() const
Grabs the object. Increments the reference counter by one.
Definition IReferenceCounted.hpp:96
virtual ~IReferenceCounted()
Destructor.
Definition IReferenceCounted.hpp:59
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
char c8
8 bit character variable.
Definition irrTypes.hpp:37
signed int i32
32 bit signed variable.
Definition irrTypes.hpp:72