TexGen
Public Member Functions | Private Attributes | List of all members
TexGen::CWeakPointer< T > Class Template Reference

Weak pointer that acts as normal pointer except when copied. More...

#include <ObjectContainer.h>

Public Member Functions

 CWeakPointer ()
 
 CWeakPointer (const CWeakPointer< T > &CopyMe)
 
CWeakPointeroperator= (T *pPointer)
 
 operator T* ()
 Conversion operator. More...
 
T * operator-> ()
 Pointer overload operator to act as a pointer of type T. More...
 
 operator const T * () const
 Conversion operator for when the class is defined as const. More...
 
const T * operator-> () const
 Pointer overload operator for the class when it is defined as const. More...
 

Private Attributes

T * m_pPointer
 Object contained within the class. More...
 

Detailed Description

template<typename T>
class TexGen::CWeakPointer< T >

Weak pointer that acts as normal pointer except when copied.

When the copy constructor is called for this class the pointer is set to NULL. This ensures that when copies of a class are made which contain pointers to their parent, the pointer will not be copied to the copied class. This is not wanted since the copied class will not necessarily be a child of the parent it was copied from.

Definition at line 107 of file ObjectContainer.h.

Constructor & Destructor Documentation

◆ CWeakPointer() [1/2]

template<typename T >
TexGen::CWeakPointer< T >::CWeakPointer ( )
inline

Definition at line 110 of file ObjectContainer.h.

◆ CWeakPointer() [2/2]

template<typename T >
TexGen::CWeakPointer< T >::CWeakPointer ( const CWeakPointer< T > &  CopyMe)
inline

Definition at line 112 of file ObjectContainer.h.

Member Function Documentation

◆ operator const T *()

template<typename T >
TexGen::CWeakPointer< T >::operator const T * ( ) const
inline

Conversion operator for when the class is defined as const.

Definition at line 129 of file ObjectContainer.h.

References TexGen::CWeakPointer< T >::m_pPointer.

◆ operator T*()

template<typename T >
TexGen::CWeakPointer< T >::operator T* ( )
inline

Conversion operator.

If the weak pointer is passed to a function that expects to receive an object of type T* then it will be converted automatically. Similarly if the container object is dereferenced an object of type T will be obtained.

Definition at line 125 of file ObjectContainer.h.

References TexGen::CWeakPointer< T >::m_pPointer.

◆ operator->() [1/2]

template<typename T >
T * TexGen::CWeakPointer< T >::operator-> ( )
inline

Pointer overload operator to act as a pointer of type T.

Definition at line 127 of file ObjectContainer.h.

References TexGen::CWeakPointer< T >::m_pPointer.

◆ operator->() [2/2]

template<typename T >
const T * TexGen::CWeakPointer< T >::operator-> ( ) const
inline

Pointer overload operator for the class when it is defined as const.

Definition at line 131 of file ObjectContainer.h.

References TexGen::CWeakPointer< T >::m_pPointer.

◆ operator=()

template<typename T >
CWeakPointer & TexGen::CWeakPointer< T >::operator= ( T *  pPointer)
inline

Definition at line 113 of file ObjectContainer.h.

References TexGen::CWeakPointer< T >::m_pPointer.

Member Data Documentation

◆ m_pPointer

template<typename T >
T* TexGen::CWeakPointer< T >::m_pPointer
private

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