globjects  1.1.0.2f0c753c8647
Strict OpenGL objects wrapper.
globjects::ref_ptr< T > Class Template Reference

The ref_ptr class provides the interface for a reference pointer. More...

#include <globjects/include/globjects/base/LogMessageBuilder.h>

Public Member Functions

 ref_ptr ()
 
 ref_ptr (T *referenced)
 
 ref_ptr (const ref_ptr &reference)
 
 ref_ptr (ref_ptr &&reference)
 
 ~ref_ptr ()
 
ref_ptroperator= (T *referenced)
 
ref_ptroperator= (const ref_ptr &reference)
 
T * get () const
 
T & operator* () const
 
T * operator-> () const
 
 operator T * () const
 
bool operator< (const ref_ptr &reference) const
 
bool operator> (const ref_ptr &reference) const
 
bool operator== (const ref_ptr &reference) const
 
bool operator!= (const ref_ptr &reference) const
 
bool operator< (T *pointer) const
 
bool operator> (T *pointer) const
 
bool operator== (T *pointer) const
 
bool operator!= (T *pointer) const
 

Protected Member Functions

void increaseRef ()
 
void decreaseRef ()
 

Protected Attributes

const Referencedm_referenced
 

Detailed Description

template<typename T>
class globjects::ref_ptr< T >

The ref_ptr class provides the interface for a reference pointer.

It is meant to be used together with subclasses of Referenced* The usage of a ref_ptr is quite the same as the work with normal pointers. This ref_ptr will be automatically cast to a normal pointer automatically so it can be used with the globjects API without any inconvenience.

Example code:

ref_ptr<VertexArrayObject> vao = new VertexArrayObject();
...
vao->drawElements(gl::GL_TRIANGLE_STRIP, 0, 4);
// vao will be deleted automatically as the ref_ptr goes out of scope
See also
Referenced

Constructor & Destructor Documentation

template<typename T>
globjects::ref_ptr< T >::ref_ptr ( )
template<typename T>
globjects::ref_ptr< T >::ref_ptr ( T *  referenced)
template<typename T>
globjects::ref_ptr< T >::ref_ptr ( const ref_ptr< T > &  reference)
template<typename T>
globjects::ref_ptr< T >::ref_ptr ( ref_ptr< T > &&  reference)
template<typename T>
globjects::ref_ptr< T >::~ref_ptr ( )

Member Function Documentation

template<typename T>
ref_ptr& globjects::ref_ptr< T >::operator= ( T *  referenced)
template<typename T>
ref_ptr& globjects::ref_ptr< T >::operator= ( const ref_ptr< T > &  reference)
template<typename T>
T* globjects::ref_ptr< T >::get ( ) const
template<typename T>
T& globjects::ref_ptr< T >::operator* ( ) const
template<typename T>
T* globjects::ref_ptr< T >::operator-> ( ) const
template<typename T>
globjects::ref_ptr< T >::operator T * ( ) const
template<typename T>
bool globjects::ref_ptr< T >::operator< ( const ref_ptr< T > &  reference) const
template<typename T>
bool globjects::ref_ptr< T >::operator> ( const ref_ptr< T > &  reference) const
template<typename T>
bool globjects::ref_ptr< T >::operator== ( const ref_ptr< T > &  reference) const
template<typename T>
bool globjects::ref_ptr< T >::operator!= ( const ref_ptr< T > &  reference) const
template<typename T>
bool globjects::ref_ptr< T >::operator< ( T *  pointer) const
template<typename T>
bool globjects::ref_ptr< T >::operator> ( T *  pointer) const
template<typename T>
bool globjects::ref_ptr< T >::operator== ( T *  pointer) const
template<typename T>
bool globjects::ref_ptr< T >::operator!= ( T *  pointer) const
template<typename T>
void globjects::ref_ptr< T >::increaseRef ( )
protected
template<typename T>
void globjects::ref_ptr< T >::decreaseRef ( )
protected

Member Data Documentation

template<typename T>
const Referenced* globjects::ref_ptr< T >::m_referenced
mutableprotected

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