ResourceRef< resType, initType > Class Template Reference
The class used to access resource data.
More...
#include <Memory/ResourceManager.h>
List of all members.
Detailed Description
template<class resType, class initType>
class ResourceRef< resType, initType >
The class used to access resource data.
- Template Parameters:
-
| resType | The type of the Resource being managed. Must inherit from the Resource class. |
| initType | The data type of the object passed into the Load function. initType must have a default constructor and have the following operators overloaded:
- bool operator==(const initType&) const
|
A ResourceRef is returned by the Resource Manager when a resource is loaded. All operation on resource data should go throught this class. This class should be treated much like a pointer. Never keep a pointer to a ResourceRef, if you need to share a resource simply copy the ResourceRef. When passing a ResourceRef to a function, always pass by value.
Member Function Documentation
template<class resType , class initType >
Gets the ResourceID.
- Returns:
- The ResourceID for this ResourceRef, or NULL_RESOURCE if this ResourceRef is invalid.
template<class resType , class initType >
bool ResourceRef< resType, initType >::IsValid |
( |
|
) |
const [inline] |
Determines if the Resource is Valid and can be used.
- Returns:
- True if the resource exists and can be used, false if the resource is invalid should not be used.
template<class resType , class initType >
ResourceRef< resType, initType >::operator bool |
( |
|
) |
const [inline] |
Overloaded bool cast operator.
- See also:
- IsValid
- Returns:
- True if the resource exists and can be used, false if the resource is invalid should not be used.
template<class resType , class initType >
bool ResourceRef< resType, initType >::operator! |
( |
|
) |
const [inline] |
Overloaded boolean negation operator.
- See also:
- IsValid
- Returns:
- True if the resource is invalid should not be used, false if the resource exists and can be used.
template<class resType , class initType >
bool ResourceRef< resType, initType >::operator!= |
( |
const ResourceRef< resType, initType > & |
ref |
) |
const [inline] |
Overloaded equality operator.
- Parameters:
-
- Returns:
- True if this ResourceRef and ref are not equal, false otherwise.
template<class resType , class initType >
const resType* ResourceRef< resType, initType >::operator-> |
( |
|
) |
const [inline] |
Constant overloaded pointer dereferance operator.
- Returns:
- A const pointer to the Resource data object.
template<class resType , class initType >
resType* ResourceRef< resType, initType >::operator-> |
( |
|
) |
[inline] |
Overloaded pointer dereferance operator.
- Returns:
- A pointer to the Resource data object.
template<class resType , class initType >
Overloaded assignment operator.
- Parameters:
-
- Returns:
- A referance to this ResourceRef.
template<class resType , class initType >
bool ResourceRef< resType, initType >::operator== |
( |
const ResourceRef< resType, initType > & |
ref |
) |
const [inline] |
Overloaded equality operator.
- Parameters:
-
- Returns:
- True if this ResourceRef and ref are equal, false otherwise.
The documentation for this class was generated from the following file: