OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Friends | List of all members
osg::ref_ptr< T > Class Template Reference

#include <ref_ptr.h>

Public Types

typedef T element_type
 

Public Member Functions

 ref_ptr ()
 
 ref_ptr (T *ptr)
 
 ref_ptr (const ref_ptr &rp)
 
template<class Other >
 ref_ptr (const ref_ptr< Other > &rp)
 
 ref_ptr (observer_ptr< T > &optr)
 
 ~ref_ptr ()
 
ref_ptroperator= (const ref_ptr &rp)
 
template<class Other >
ref_ptroperator= (const ref_ptr< Other > &rp)
 
ref_ptroperator= (T *ptr)
 
bool operator== (const ref_ptr &rp) const
 
bool operator== (const T *ptr) const
 
bool operator!= (const ref_ptr &rp) const
 
bool operator!= (const T *ptr) const
 
bool operator< (const ref_ptr &rp) const
 
 operator unspecified_bool_type () const
 
T & operator* () const
 
T * operator-> () const
 
T * get () const
 
bool operator! () const
 
bool valid () const
 
T * release ()
 
void swap (ref_ptr &rp)
 

Friends

template<class Other >
class ref_ptr
 
bool operator== (const T *ptr, const ref_ptr &rp)
 
bool operator!= (const T *ptr, const ref_ptr &rp)
 

Detailed Description

template<class T>
class osg::ref_ptr< T >

Smart pointer for handling referenced counted objects.

Definition at line 25 of file ref_ptr.h.

Member Typedef Documentation

template<class T>
typedef T osg::ref_ptr< T >::element_type

Definition at line 28 of file ref_ptr.h.

Constructor & Destructor Documentation

template<class T>
osg::ref_ptr< T >::ref_ptr ( )
inline

Definition at line 30 of file ref_ptr.h.

template<class T>
osg::ref_ptr< T >::ref_ptr ( T *  ptr)
inline

Definition at line 31 of file ref_ptr.h.

template<class T>
osg::ref_ptr< T >::ref_ptr ( const ref_ptr< T > &  rp)
inline

Definition at line 32 of file ref_ptr.h.

template<class T>
template<class Other >
osg::ref_ptr< T >::ref_ptr ( const ref_ptr< Other > &  rp)
inline

Definition at line 33 of file ref_ptr.h.

template<class T>
osg::ref_ptr< T >::ref_ptr ( observer_ptr< T > &  optr)
inline

Definition at line 34 of file ref_ptr.h.

template<class T>
osg::ref_ptr< T >::~ref_ptr ( )
inline

Definition at line 35 of file ref_ptr.h.

Member Function Documentation

template<class T>
T* osg::ref_ptr< T >::get ( ) const
inline

Definition at line 92 of file ref_ptr.h.

Here is the caller graph for this function:

template<class T>
osg::ref_ptr< T >::operator unspecified_bool_type ( ) const
inline

Definition at line 87 of file ref_ptr.h.

template<class T>
bool osg::ref_ptr< T >::operator! ( ) const
inline

Definition at line 94 of file ref_ptr.h.

template<class T>
bool osg::ref_ptr< T >::operator!= ( const ref_ptr< T > &  rp) const
inline

Definition at line 71 of file ref_ptr.h.

template<class T>
bool osg::ref_ptr< T >::operator!= ( const T *  ptr) const
inline

Definition at line 72 of file ref_ptr.h.

template<class T>
T& osg::ref_ptr< T >::operator* ( ) const
inline

Definition at line 90 of file ref_ptr.h.

template<class T>
T* osg::ref_ptr< T >::operator-> ( ) const
inline

Definition at line 91 of file ref_ptr.h.

template<class T>
bool osg::ref_ptr< T >::operator< ( const ref_ptr< T > &  rp) const
inline

Definition at line 75 of file ref_ptr.h.

template<class T>
ref_ptr& osg::ref_ptr< T >::operator= ( const ref_ptr< T > &  rp)
inline

Definition at line 37 of file ref_ptr.h.

template<class T>
template<class Other >
ref_ptr& osg::ref_ptr< T >::operator= ( const ref_ptr< Other > &  rp)
inline

Definition at line 43 of file ref_ptr.h.

template<class T>
ref_ptr& osg::ref_ptr< T >::operator= ( T *  ptr)
inline

Definition at line 49 of file ref_ptr.h.

template<class T>
bool osg::ref_ptr< T >::operator== ( const ref_ptr< T > &  rp) const
inline

Definition at line 67 of file ref_ptr.h.

template<class T>
bool osg::ref_ptr< T >::operator== ( const T *  ptr) const
inline

Definition at line 68 of file ref_ptr.h.

template<class T>
T* osg::ref_ptr< T >::release ( )
inline

release the pointer from ownership by this ref_ptr<>, decrementing the objects refencedCount() via unref_nodelete() to prevent the Object object from being deleted even if the reference count goes to zero. Use when using a local ref_ptr<> to an Object that you want to return from a function/method via a C pointer, whilst preventing the normal ref_ptr<> destructor from cleaning up the object. When using release() you are implicitly expecting other code to take over management of the object, otherwise a memory leak will result.

Definition at line 101 of file ref_ptr.h.

Here is the caller graph for this function:

template<class T>
void osg::ref_ptr< T >::swap ( ref_ptr< T > &  rp)
inline

Definition at line 103 of file ref_ptr.h.

Here is the caller graph for this function:

template<class T>
bool osg::ref_ptr< T >::valid ( ) const
inline

Definition at line 95 of file ref_ptr.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

template<class T>
bool operator!= ( const T *  ptr,
const ref_ptr< T > &  rp 
)
friend

Definition at line 73 of file ref_ptr.h.

template<class T>
bool operator== ( const T *  ptr,
const ref_ptr< T > &  rp 
)
friend

Definition at line 69 of file ref_ptr.h.

template<class T>
template<class Other >
friend class ref_ptr
friend

Definition at line 119 of file ref_ptr.h.


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