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