Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ref< T > Class Template Reference

Reference counting helper. More...

#include <mitsuba/mitsuba.h>

Public Member Functions

 ref ()
 Create a NULL reference. More...
 
 ref (T *ptr)
 Construct a reference from a pointer. More...
 
 ref (const ref &pRef)
 Copy-constructor. More...
 
 ~ref ()
 Destroy this reference. More...
 
refoperator= (const ref &r)
 Overwrite this reference with another reference. More...
 
refoperator= (T *ptr)
 Overwrite this reference with a pointer to another object. More...
 
bool operator== (const ref &pref) const
 Compare this reference with another reference. More...
 
bool operator!= (const ref &pref) const
 Compare this reference with another reference. More...
 
bool operator== (const T *ptr) const
 Compare this reference with a pointer. More...
 
bool operator!= (const T *ptr) const
 Compare this reference with a pointer. More...
 
bool operator! () const
 Check whether this is a NULL reference. More...
 
T * operator-> ()
 Access the object referenced by this reference. More...
 
const T * operator-> () const
 Access the object referenced by this reference. More...
 
T & operator* ()
 Return a C++ reference to the referenced object. More...
 
const T & operator* () const
 Return a C++ reference to the referenced object. More...
 
 operator T * ()
 Return a pointer to the referenced object. More...
 
T * get ()
 Return a pointer to the referenced object. More...
 
const T * get () const
 Return a pointer to the referenced object. More...
 
std::string toString () const
 

Detailed Description

template<typename T>
class ref< T >

Reference counting helper.

The ref refeference template is a simple wrapper to store a pointer to an object. It takes care of increasing and decreasing the reference count of the object. When the last reference goes out of scope, the associated object will be deallocated.

Author
Wenzel Jakob

Constructor & Destructor Documentation

template<typename T>
ref< T >::ref ( )
inline

Create a NULL reference.

template<typename T>
ref< T >::ref ( T *  ptr)
inline

Construct a reference from a pointer.

template<typename T>
ref< T >::ref ( const ref< T > &  pRef)
inline

Copy-constructor.

template<typename T>
ref< T >::~ref ( )
inline

Destroy this reference.

Member Function Documentation

template<typename T>
T* ref< T >::get ( )
inline

Return a pointer to the referenced object.

template<typename T>
const T* ref< T >::get ( ) const
inline

Return a pointer to the referenced object.

template<typename T>
ref< T >::operator T * ( )
inline

Return a pointer to the referenced object.

template<typename T>
bool ref< T >::operator! ( ) const
inline

Check whether this is a NULL reference.

template<typename T>
bool ref< T >::operator!= ( const ref< T > &  pref) const
inline

Compare this reference with another reference.

template<typename T>
bool ref< T >::operator!= ( const T *  ptr) const
inline

Compare this reference with a pointer.

template<typename T>
T& ref< T >::operator* ( )
inline

Return a C++ reference to the referenced object.

template<typename T>
const T& ref< T >::operator* ( ) const
inline

Return a C++ reference to the referenced object.

template<typename T>
T* ref< T >::operator-> ( )
inline

Access the object referenced by this reference.

template<typename T>
const T* ref< T >::operator-> ( ) const
inline

Access the object referenced by this reference.

template<typename T>
ref& ref< T >::operator= ( const ref< T > &  r)
inline

Overwrite this reference with another reference.

template<typename T>
ref& ref< T >::operator= ( T *  ptr)
inline

Overwrite this reference with a pointer to another object.

template<typename T>
bool ref< T >::operator== ( const ref< T > &  pref) const
inline

Compare this reference with another reference.

template<typename T>
bool ref< T >::operator== ( const T *  ptr) const
inline

Compare this reference with a pointer.

template<typename T>
std::string ref< T >::toString ( ) const
inline

Return a string representation of this reference


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