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_ptr & | operator= (T *referenced)
ref_ptr & | operator= (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 Referenced * | m_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

## ref_ptr() [1/4]

template<typename T>

globjects::ref_ptr< T >::ref_ptr | ( |  | ) |

## ref_ptr() [2/4]

template<typename T>

globjects::ref_ptr< T >::ref_ptr | ( | T * | referenced | ) |

## ref_ptr() [3/4]

template<typename T>

globjects::ref_ptr< T >::ref_ptr | ( | const ref_ptr< T > & | reference | ) |

## ref_ptr() [4/4]

template<typename T>

globjects::ref_ptr< T >::ref_ptr | ( | ref_ptr< T > && | reference | ) |

## ~ref_ptr()

template<typename T>

globjects::ref_ptr< T >::~ref_ptr | ( |  | ) |

## Member Function Documentation

## operator=() [1/2]

template<typename T>

ref_ptr& globjects::ref_ptr< T >::operator= | ( | T * | referenced | ) |

## operator=() [2/2]

template<typename T>

ref_ptr& globjects::ref_ptr< T >::operator= | ( | const ref_ptr< T > & | reference | ) |

## get()

template<typename T>

T* globjects::ref_ptr< T >::get | ( |  | ) | const

## operator*()

template<typename T>

T& globjects::ref_ptr< T >::operator* | ( |  | ) | const

## operator->()

template<typename T>

T* globjects::ref_ptr< T >::operator-> | ( |  | ) | const

## operator T*()

template<typename T>

globjects::ref_ptr< T >::operator T* | ( |  | ) | const

## operator<() [1/2]

template<typename T>

bool globjects::ref_ptr< T >::operator< | ( | const ref_ptr< T > & | reference | ) | const

## operator>() [1/2]

template<typename T>

bool globjects::ref_ptr< T >::operator> | ( | const ref_ptr< T > & | reference | ) | const

## operator==() [1/2]

template<typename T>

bool globjects::ref_ptr< T >::operator== | ( | const ref_ptr< T > & | reference | ) | const

## operator!=() [1/2]

template<typename T>

bool globjects::ref_ptr< T >::operator!= | ( | const ref_ptr< T > & | reference | ) | const

## operator<() [2/2]

template<typename T>

bool globjects::ref_ptr< T >::operator< | ( | T * | pointer | ) | const

## operator>() [2/2]

template<typename T>

bool globjects::ref_ptr< T >::operator> | ( | T * | pointer | ) | const

## operator==() [2/2]

template<typename T>

bool globjects::ref_ptr< T >::operator== | ( | T * | pointer | ) | const

## operator!=() [2/2]

template<typename T>

bool globjects::ref_ptr< T >::operator!= | ( | T * | pointer | ) | const

## increaseRef()

template<typename T>

void globjects::ref_ptr< T >::increaseRef | ( |  | ) |

protected

## decreaseRef()

template<typename T>

void globjects::ref_ptr< T >::decreaseRef | ( |  | ) |

protected

## Member Data Documentation

## m_referenced

template<typename T>

const Referenced* globjects::ref_ptr< T >::m_referenced

mutable protected

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

- LogMessageBuilder.h
- ref_ptr.h