ResourceOld< T > Class Template Reference

#include <resManager.h>

Inheritance diagram for ResourceOld< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description


template<class T> class ResourceOld< T >

Wrapper class around a ResourceInstance subclass.

    // Loading a resource...
    ResourceOld<TerrainFile> terrRes;

    terrRes = gResourceManager->load(fileName);
    if(!bool(terrRes))
       Con::errorf(ConsoleLogEntry::General, "Terraformer::terrainFile - invalid terrain file '%s'.", fileName);

When the ResourceOld<> is destroyed, it frees the lock on the resource.

See also:
ResManager


Public Member Functions

 ResourceOld ()
 If assigned a ResourceObject, it's assumed to already have been locked, lock count is incremented only for copies or assignment from another ResourceOld.
 ResourceOld (ResourceObject *p)
 ResourceOld (const ResourceOld &res)
 ~ResourceOld ()
 Decrements the lock count on this object, and if the lock count is 0 afterwards,.
const char * getFilePath () const
 < adds the object to the timeoutList for deletion on execution of purge(). Returns the path of the file (without the actual name)
const char * getFileName () const
 Returns the actual file name (without the path).
ResourceOldoperator= (ResourceObject *p)
ResourceOldoperator= (const ResourceOld &r)
U32 getCRC ()
bool isNull () const
 operator bool () const
bool operator! () const
T * operator-> ()
T & operator * ()
 operator T * () const
const T * operator-> () const
const T & operator * () const
 operator const T * () const
void unlock ()
void purge ()

Private Member Functions

void _lock ()
 Increments the lock count on this object.
void _unlock ()
 Decrements the lock count on this object.

Private Attributes

ResourceObjectobj
 Actual resource object.


Constructor & Destructor Documentation

template<class T>
ResourceOld< T >::ResourceOld (  )  [inline]

If assigned a ResourceObject, it's assumed to already have been locked, lock count is incremented only for copies or assignment from another ResourceOld.

template<class T>
ResourceOld< T >::ResourceOld ( ResourceObject p  )  [inline]

template<class T>
ResourceOld< T >::ResourceOld ( const ResourceOld< T > &  res  )  [inline]

template<class T>
ResourceOld< T >::~ResourceOld (  )  [inline]

Decrements the lock count on this object, and if the lock count is 0 afterwards,.


Member Function Documentation

template<class T>
void ResourceOld< T >::_lock (  )  [inline, private]

Increments the lock count on this object.

template<class T>
void ResourceOld< T >::_unlock (  )  [inline, private]

Decrements the lock count on this object.

template<class T>
const char* ResourceOld< T >::getFilePath (  )  const [inline]

< adds the object to the timeoutList for deletion on execution of purge(). Returns the path of the file (without the actual name)

template<class T>
const char* ResourceOld< T >::getFileName (  )  const [inline]

Returns the actual file name (without the path).

template<class T>
ResourceOld& ResourceOld< T >::operator= ( ResourceObject p  )  [inline]

template<class T>
ResourceOld& ResourceOld< T >::operator= ( const ResourceOld< T > &  r  )  [inline]

template<class T>
U32 ResourceOld< T >::getCRC (  )  [inline]

template<class T>
bool ResourceOld< T >::isNull (  )  const [inline]

template<class T>
ResourceOld< T >::operator bool (  )  const [inline]

template<class T>
bool ResourceOld< T >::operator! (  )  const [inline]

template<class T>
T* ResourceOld< T >::operator-> (  )  [inline]

template<class T>
T& ResourceOld< T >::operator * (  )  [inline]

template<class T>
ResourceOld< T >::operator T * (  )  const [inline]

template<class T>
const T* ResourceOld< T >::operator-> (  )  const [inline]

template<class T>
const T& ResourceOld< T >::operator * (  )  const [inline]

template<class T>
ResourceOld< T >::operator const T * (  )  const [inline]

template<class T>
void ResourceOld< T >::unlock (  )  [inline]

template<class T>
void ResourceOld< T >::purge (  )  [inline]


Member Data Documentation

template<class T>
ResourceObject* ResourceOld< T >::obj [private]

Actual resource object.