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;
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
dcpp::int32_kt getReferenceCount() const
Get the reference count.
Definition IReferenceCounted.hpp:143
IReferenceCounted()
Constructor.
Definition IReferenceCounted.hpp:50
void grab() const
Grabs the object. Increments the reference counter by one.
Definition IReferenceCounted.hpp:96
void setDebugName(const dcpp::char_kt *newName)
Sets the debug name of the object.
Definition IReferenceCounted.hpp:163
const dcpp::char_kt * getDebugName() const
Returns the debug name of the object.
Definition IReferenceCounted.hpp:152
virtual ~IReferenceCounted()
Destructor.
Definition IReferenceCounted.hpp:59
As of Duckcpp 1.6, position2d is a synonym for vector2d.
Definition shared_device.hpp:34
char char_kt
8 bit character variable.
Definition irrTypes.hpp:37
signed int int32_kt
32 bit signed variable.
Definition irrTypes.hpp:72