Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Private Attributes | List of all members
ResourcePtr< ResourceType > Class Template Reference

Wrapper for low level resources and high level assets. More...

#include <ResourcePtr.h>

Public Member Functions

 ResourcePtr ()
 
 ResourcePtr (ResourceType *ptr)
 
 ~ResourcePtr ()
 
 ResourcePtr (const ResourcePtr &other)
 
 ResourcePtr (ResourcePtr &&other)
 
void operator= (ResourceType *ptr)
 
void operator= (const ResourcePtr< ResourceType > &ptr)
 
 operator void * () const
 
ResourceType * operator* ()
 
ResourceType * operator-> ()
 
const ResourceType * operator* () const
 
const ResourceType * operator-> () const
 
void ReleaseResource ()
 
void AssignPointer (ResourceType *ptr)
 
ResourceType * Ptr () const
 

Private Attributes

ResourceType * m_resource
 

Detailed Description

template<typename ResourceType>
class ResourcePtr< ResourceType >

Wrapper for low level resources and high level assets.

This class automatically increments and decrements resources and assets reference counter. Notice that it's not equivalent of std::shared_ptr. When references counter reaches 0, resource won't be released. AssetsManager is the only one owner of resource and it's responsibility is, to destroy resource when it's needed. Even when there's no Actor in engine that uses it, resource can still remain for future use.

Constructor & Destructor Documentation

template<typename ResourceType>
ResourcePtr< ResourceType >::ResourcePtr ( )
inline
template<typename ResourceType>
ResourcePtr< ResourceType >::ResourcePtr ( ResourceType *  ptr)
inline
template<typename ResourceType>
ResourcePtr< ResourceType >::~ResourcePtr ( )
inline
template<typename ResourceType>
ResourcePtr< ResourceType >::ResourcePtr ( const ResourcePtr< ResourceType > &  other)
inline
template<typename ResourceType>
ResourcePtr< ResourceType >::ResourcePtr ( ResourcePtr< ResourceType > &&  other)
inline

Member Function Documentation

template<typename ResourceType>
void ResourcePtr< ResourceType >::AssignPointer ( ResourceType *  ptr)
inline
template<typename ResourceType>
ResourcePtr< ResourceType >::operator void * ( ) const
inline
template<typename ResourceType>
ResourceType* ResourcePtr< ResourceType >::operator* ( )
inline
template<typename ResourceType>
const ResourceType* ResourcePtr< ResourceType >::operator* ( ) const
inline
template<typename ResourceType>
ResourceType* ResourcePtr< ResourceType >::operator-> ( )
inline
template<typename ResourceType>
const ResourceType* ResourcePtr< ResourceType >::operator-> ( ) const
inline
template<typename ResourceType>
void ResourcePtr< ResourceType >::operator= ( ResourceType *  ptr)
inline
template<typename ResourceType>
void ResourcePtr< ResourceType >::operator= ( const ResourcePtr< ResourceType > &  ptr)
inline
template<typename ResourceType>
ResourceType* ResourcePtr< ResourceType >::Ptr ( ) const
inline
template<typename ResourceType>
void ResourcePtr< ResourceType >::ReleaseResource ( )
inline

Member Data Documentation

template<typename ResourceType>
ResourceType* ResourcePtr< ResourceType >::m_resource
private

The documentation for this class was generated from the following file: