The Nebula Device 3: Core::RefCounted Class Reference

The Nebula Device 3

Core::RefCounted Class Reference

#include <refcounted.h>

Inheritance diagram for Core::RefCounted:

AsyncGraphics::DisplayProxy AsyncGraphics::GraphicsEntityProxy AsyncGraphics::GraphicsServerProxy AsyncGraphics::ViewProxy Attr::AttributeTable Base::DisplayDeviceBase Base::InputServerBase Base::RenderDeviceBase Base::RenderTargetBase Base::ShaderInstanceBase Base::ShaderServerBase Base::ShaderVariableBase Base::ShaderVariableInstanceBase Base::ShaderVariationBase Base::ShapeRendererBase Base::TransformDeviceBase Base::VertexLayoutBase BaseGameFeature::EntityLoaderBase BaseGameFeature::LoaderServer BaseGameFeature::UserProfile Core::CoreServer CoreGraphics::DisplayEventHandler CoreGraphics::RenderEventHandler CoreGraphics::VertexLayoutServer Frame::FrameBatch Frame::FramePass Frame::FramePostEffect Frame::FrameServer Frame::FrameShader Game::Entity Game::FeatureUnit Game::GameServer Graphics::Cell Graphics::GraphicsEntity Graphics::GraphicsServer Graphics::Stage Graphics::StageBuilder Graphics::View Http::HttpRequestHandler Http::HttpServer Input::InputHandler IO::Console IO::ConsoleHandler IO::IoServer IO::Stream IO::StreamReader IO::StreamWriter IO::ZipArchive IO::ZipDirEntry IO::ZipFileEntry IO::ZipFileSystem Lighting::LightServerBase Messaging::AsyncPort Messaging::Handler Messaging::Message Messaging::Port Models::ModelInstance Models::ModelNode Models::ModelNodeInstance Models::ModelServer Models::VisResolver Net::TcpClient Net::TcpClientConnection Net::TcpServer Resources::ManagedResource Resources::Resource Resources::ResourceLoader Resources::ResourceManager Resources::ResourceMapper Resources::ResourceSaver Resources::SharedResourceServer Scripting::Command Scripting::ScriptServer Win32::Win32Socket Win32::Win32Thread


Detailed Description

The common base class of Nebula3. Implement a strong refcounted mechanism and runtime type information. Nebula3 checks at application shutdown for propert cleanup of all RefCounted objects. Refcounting leaks will generate a log on the debug output.

(C) 2006 RadonLabs GmbH

Public Member Functions

 RefCounted ()
 constructor
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Protected Member Functions

virtual ~RefCounted ()
 destructor (called when refcount reaches zero)

Member Function Documentation

int Core::RefCounted::GetRefCount (  )  const [inline]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.