5#ifndef JPP_I_IREFERENCE_COUNTED_HPP_INCLUDED
6#define JPP_I_IREFERENCE_COUNTED_HPP_INCLUDED
8#include <jimcpp/core/engine/jpp_types.hpp>
10#ifdef _JPP_COMPILE_WITH_LEAK_HUNTER_
11 #include <jimcpp/core/engine/leakHunter.hpp>
51 : DebugName(0), ReferenceCounter(1)
53#ifdef _JPP_COMPILE_WITH_LEAK_HUNTER_
54 LeakHunter::addObject(
this);
61 #ifdef _JPP_COMPILE_WITH_LEAK_HUNTER_
62 LeakHunter::removeObject(
this);
96 void grab()
const { ++ReferenceCounter; }
129 JPP_DEBUG_BREAK_IF(ReferenceCounter <= 0)
132 if (!ReferenceCounter)
145 return ReferenceCounter;
174 mutable s32 ReferenceCounter;
Base class of most objects of the Jimcpp Engine.
Definition IReferenceCounted.hpp:46
void grab() const
Grabs the object. Increments the reference counter by one.
Definition IReferenceCounted.hpp:96
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
virtual ~IReferenceCounted()
Destructor.
Definition IReferenceCounted.hpp:59
IReferenceCounted()
Constructor.
Definition IReferenceCounted.hpp:50
As of Jimcpp 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