56 bool IsA(
const Rtti& rtti)
const;
74 SizeT overallRefCount;
90 static ThreadLocal
bool isInCreate;
95 RefCountedList::Iterator listIterator;
110 n_assert2(this->isInCreate,
"RefCounted objects must be created with Create()!");
111 this->listIterator = list.AddBack(
this);
112 this->destroyed =
false;
155 return this->GetRtti() == &other;
164 return this->GetRtti()->
GetName() == other;
173 return this->GetRtti()->GetFourCC() == other;
182 return this->GetRtti()->IsDerivedFrom(other);
191 return this->GetRtti()->IsDerivedFrom(other);
200 return this->GetRtti()->IsDerivedFrom(other);
210 return this->GetRtti()->GetName();
220 return this->GetRtti()->GetFourCC();
230 list.SetDebugName(
this, name);
The common base class of Nebula.
Definition refcounted.h:38
void AddRef()
increment refcount by one
Definition refcounted.h:121
RefCounted()
constructor
Definition refcounted.h:106
bool IsA(const Rtti &rtti) const
return true if this object is instance of given class, or a derived class
Definition refcounted.h:180
int GetRefCount() const
get the current refcount
Definition refcounted.h:144
void Release()
decrement refcount and destroy object if refcount is zero
Definition refcounted.h:131
static void DumpRefCountingLeaks()
dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
Definition refcounted.cc:45
bool IsInstanceOf(const Rtti &rtti) const
return true if this object is instance of given class
Definition refcounted.h:153
virtual ~RefCounted()
destructor (called when refcount reaches zero)
Definition refcounted.cc:25
__DeclareClass(RefCounted)
volatile int refCount
Definition refcounted.h:86
Util::FourCC GetClassFourCC() const
get the class FourCC code
Definition refcounted.h:218
const Util::String & GetClassName() const
get the class name
Definition refcounted.h:208
Implements a static list which keeps track of all refcounted objects to detect refcounting leaks at a...
Definition refcountedlist.h:24
Nebula's runtime type information for one class.
Definition rtti.h:27
const Util::String & GetName() const
get class name
Definition rtti.h:100
Critical section objects are used to protect a portion of code from parallel execution.
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
A four-character-code is a quasi-human-readable 32-bit-id.
Definition fourcc.h:19
#define n_assert2(exp, msg)
Definition debug.h:51
Definition coreserver.cc:11
int Decrement(int volatile *var)
interlocked decrement, return result
Definition gccinterlocked.cc:157
int Increment(int volatile *var)
interlocked increment, return result
Definition gccinterlocked.cc:148
Nebula's universal string class.
Definition string.h:50
int SizeT
Definition types.h:49