Open Inventor Reference
SoRef< T > Class Template Reference

SoRef proves an intrusive smart pointer for any SoBase derived class and uses the ref()/unref() methods of SoBase to manage the ref counting. More...

#include <Inventor/misc/SoRef.h>

Public Member Functions

 SoRef ()
 
 SoRef (const SoRef< T > &p)
 
 SoRef (T *o)
 
 ~SoRef ()
 
SoRef< T > & operator= (const SoRef< T > &p)
 
template<class T2 >
SoRef< T > & operator= (const SoRef< T2 > &p)
 
SoRef< T > & operator= (T *o)
 
bool operator== (const SoRef< T > &p) const
 
bool operator!= (const SoRef< T > &p) const
 
bool operator== (T *p) const
 
bool operator!= (T *p) const
 
T * operator-> () const
 
T & operator* () const
 
 operator T* () const
 Get access to the underlying pointer automatically.
 
T * ptr () const
 Get access to the underlying pointer (VSG compatibility).
 
T * get () const
 Get access to the underlying pointer.
 
T * releaseNoDelete ()
 Get access to the underlying pointer without deleting the object.
 

Protected Member Functions

void setObject (T *o)
 

Detailed Description

template<class T>
class SoRef< T >

Definition at line 10 of file SoRef.h.

Constructor & Destructor Documentation

◆ SoRef() [1/3]

template<class T >
SoRef< T >::SoRef ( )
inline

Definition at line 13 of file SoRef.h.

◆ SoRef() [2/3]

template<class T >
SoRef< T >::SoRef ( const SoRef< T > &  p)
inline

Definition at line 15 of file SoRef.h.

References SoRef< T >::setObject().

◆ SoRef() [3/3]

template<class T >
SoRef< T >::SoRef ( T *  o)
inline

Definition at line 19 of file SoRef.h.

◆ ~SoRef()

template<class T >
SoRef< T >::~SoRef ( )
inline

Definition at line 26 of file SoRef.h.

Member Function Documentation

◆ get()

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

Definition at line 72 of file SoRef.h.

◆ operator T*()

template<class T >
SoRef< T >::operator T* ( ) const
inline

This was deprecated at VSG, but we consider it more useful than dangerous.

Definition at line 66 of file SoRef.h.

◆ operator!=() [1/2]

template<class T >
bool SoRef< T >::operator!= ( const SoRef< T > &  p) const
inline

Definition at line 48 of file SoRef.h.

◆ operator!=() [2/2]

template<class T >
bool SoRef< T >::operator!= ( T *  p) const
inline

Definition at line 56 of file SoRef.h.

◆ operator*()

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

Definition at line 62 of file SoRef.h.

◆ operator->()

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

Definition at line 60 of file SoRef.h.

◆ operator=() [1/3]

template<class T >
SoRef< T > & SoRef< T >::operator= ( const SoRef< T > &  p)
inline

Definition at line 28 of file SoRef.h.

References SoRef< T >::setObject().

◆ operator=() [2/3]

template<class T >
template<class T2 >
SoRef< T > & SoRef< T >::operator= ( const SoRef< T2 > &  p)
inline

Definition at line 34 of file SoRef.h.

References SoRef< T >::setObject().

◆ operator=() [3/3]

template<class T >
SoRef< T > & SoRef< T >::operator= ( T *  o)
inline

Definition at line 39 of file SoRef.h.

References SoRef< T >::setObject().

◆ operator==() [1/2]

template<class T >
bool SoRef< T >::operator== ( const SoRef< T > &  p) const
inline

Definition at line 44 of file SoRef.h.

◆ operator==() [2/2]

template<class T >
bool SoRef< T >::operator== ( T *  p) const
inline

Definition at line 52 of file SoRef.h.

◆ ptr()

template<class T >
T * SoRef< T >::ptr ( ) const
inline

Definition at line 69 of file SoRef.h.

◆ releaseNoDelete()

template<class T >
T * SoRef< T >::releaseNoDelete ( )
inline

This is useful in some places where the user knows that he will pass the object to a place which will take over ref counting.

Definition at line 77 of file SoRef.h.

◆ setObject()

template<class T >
void SoRef< T >::setObject ( T *  o)
inlineprotected

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