OpenBarnyard
 
Loading...
Searching...
No Matches
TRef< T > Class Template Reference

#include <TRefCounted.h>

Public Member Functions

constexpr TRef ()
 
 TRef (T *a_pPtr)
 
 TRef (const TRef &a_rcOther)
 
 TRef (TRef &&a_rOther)
 
 ~TRef ()
 
TRefoperator= (T *a_pPtr)
 
TRefoperator= (const TRef &a_rOther)
 
T * Get ()
 
const T * Get () const
 
T * operator-> ()
 
const T * operator-> () const
 
 operator T* ()
 
 operator const T * () const
 

Protected Attributes

T * m_pPtr
 

Detailed Description

template<class T>
class TRef< T >

Definition at line 23 of file TRefCounted.h.

Constructor & Destructor Documentation

◆ TRef() [1/4]

template<class T>
TRef< T >::TRef ( )
inlineconstexpr

Definition at line 27 of file TRefCounted.h.

28 : m_pPtr( TNULL )
29 {
30 }
T * m_pPtr

◆ TRef() [2/4]

template<class T>
TRef< T >::TRef ( T * a_pPtr)
inline

Definition at line 32 of file TRefCounted.h.

33 : m_pPtr( TNULL )
34 {
35 Create( a_pPtr );
36 }

◆ TRef() [3/4]

template<class T>
TRef< T >::TRef ( const TRef< T > & a_rcOther)
inline

Definition at line 38 of file TRefCounted.h.

39 : m_pPtr( TNULL )
40 {
41 Create( a_rcOther.m_pPtr );
42 }

◆ TRef() [4/4]

template<class T>
TRef< T >::TRef ( TRef< T > && a_rOther)
inline

Definition at line 44 of file TRefCounted.h.

45 {
47 m_pPtr = TNULL;
48 }

◆ ~TRef()

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

Definition at line 50 of file TRefCounted.h.

50{ Destroy(); }

Member Function Documentation

◆ Get() [1/2]

template<class T>
T * TRef< T >::Get ( )
inline

Definition at line 72 of file TRefCounted.h.

72{ return m_pPtr; }

◆ Get() [2/2]

template<class T>
const T * TRef< T >::Get ( ) const
inline

Definition at line 73 of file TRefCounted.h.

73{ return m_pPtr; }

◆ operator const T *()

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

Definition at line 79 of file TRefCounted.h.

79{ return m_pPtr; }

◆ operator T*()

template<class T>
TRef< T >::operator T* ( )
inline

Definition at line 78 of file TRefCounted.h.

78{ return m_pPtr; }

◆ operator->() [1/2]

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

Definition at line 75 of file TRefCounted.h.

75{ return m_pPtr; }

◆ operator->() [2/2]

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

Definition at line 76 of file TRefCounted.h.

76{ return m_pPtr; }

◆ operator=() [1/2]

template<class T>
TRef & TRef< T >::operator= ( const TRef< T > & a_rOther)
inline

Definition at line 62 of file TRefCounted.h.

63 {
64 if ( a_rOther.m_pPtr != m_pPtr )
65 {
66 Create( a_rOther.m_pPtr );
67 }
68
69 return *this;
70 }

◆ operator=() [2/2]

template<class T>
TRef & TRef< T >::operator= ( T * a_pPtr)
inline

Definition at line 52 of file TRefCounted.h.

53 {
54 if ( a_pPtr != m_pPtr )
55 {
56 Create( a_pPtr );
57 }
58
59 return *this;
60 }

Member Data Documentation

◆ m_pPtr

template<class T>
T* TRef< T >::m_pPtr
protected

Definition at line 104 of file TRefCounted.h.


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