GEL  2
GEL is a library for Geometry and Linear Algebra
Public Member Functions | Friends
Util::ResourcePtr< RES > Class Template Reference

Template for a pointer to a reference counted resource. More...

#include <ResourceManager.h>

List of all members.

Public Member Functions

 ResourcePtr (const ResourcePtr &r2)
const ResourcePtroperator= (const ResourcePtr &r2)
RES & operator* () const
RES *const operator-> () const
RES *const get_raw_ptr () const
int usage () const
bool is_valid () const
void relinquish_resource ()
void remove_when_unused ()

Friends

class ResourceManager< RES >

Detailed Description

template<class RES>
class Util::ResourcePtr< RES >

Template for a pointer to a reference counted resource.

The ResourcePtr class template is a template for a reference counted resource pointer. It is a smart pointer that actually points to a ResourceRecord and not to the actual resource. Since the record contains a reference count, we can increase the reference count when the pointer is copied and decrease it in the destructor. Only the ResourceManager can create ResourcePtr's directly from a raw ResourceRecord.


Member Function Documentation

template<class RES>
void Util::ResourcePtr< RES >::remove_when_unused ( ) [inline]

Calling this function sets the REMOVE_WHEN_UNUSED flag. If this flag is set, the resource record is removed from the manager


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations