The Nebula Device 3: Resources::PoolLoadingResource Class Reference

The Nebula Device 3

Resources::PoolLoadingResource Class Reference

#include <poolloadingresource.h>

Inheritance diagram for Resources::PoolLoadingResource:

Resources::LoadingResource Core::RefCounted

Detailed Description

A specialized LoadingResource for pool using strategies.

(C) 2010 Radon Labs GmbH

Public Member Functions

 PoolLoadingResource ()
 constructor
 ~PoolLoadingResource ()
 destructor
const Ptr< ResourceSlot > & GetNewSlot () const
 get target slot (slot we want to load)
const Ptr< ResourceSlot > & GetOldSlot () const
 get the source slot (slot we want to reuse)
void SetTargetSlot (const Ptr< ResourceSlot > &targetSlot)
 set target slot (slot we want to load)
void SetSourceSlot (const Ptr< ResourceSlot > &srcSlot)
 set the source slot (slot we want to reuse)
virtual void OnSuccessRequest ()
 called as the request was performed successfully
int GetPriority () const
 returns loading-priority-value
const Ptr< ManagedResource > & GetManagedResource () const
 returns ManagedResource
const Ptr< Resource > & GetTargetResource () const
 returns Resource we want to load to
void SetManagedResource (const Ptr< ManagedResource > &managedResource)
 set ManagedResource
void SetTargetResource (const Ptr< Resource > &targetResource)
 set target resource (resource we want to load)
void SetPriority (int priority)
 set the loading-priority
virtual void OnCancelRequest ()
 called as the request is aborted (canceled, aborted, failed, ...)
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 Attributes

Ptr< ResourceSlot > newSlot
 the slot containing the resource to load
Ptr< ResourceSlot > oldSlot
 the slot our ManagedResource' Resource is currently contained at (may be 0!)
Ptr< ManagedResourcemanagedResource
 the managed resource we place on the resource after successful loading
Ptr< ResourcetargetResource
 the resource we want to load

Friends

bool operator< (const LoadingResource &a, const LoadingResource &b)
 less-than operator

Member Function Documentation

void Resources::LoadingResource::OnCancelRequest (  )  [virtual, inherited]

called as the request is aborted (canceled, aborted, failed, ...)

Do everything needed in here which has to be performed as a loading request is going to be terminated because it was canceled, aborted, failed and so on.

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

get the current refcount

Return the current refcount of the object.

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

increment refcount by one

Increment the refcount of the object.

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

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, inherited]

get the class name

Get the class name of the object.

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

get the class FourCC code

Get the class FourCC of the object.

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

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.