ezEngine  Milestone 7
ezScopedRefPointer< T > Class Template Reference

Stores a pointer to a reference counted object and automatically increases / decreases the reference count. More...

#include <RefCounted.h>

Public Member Functions

 ezScopedRefPointer ()
 Constructor.
 
 ezScopedRefPointer (T *pReferencedObject)
 Constructor, increases the ref count of the given object.
 
 ezScopedRefPointer (const ezScopedRefPointer< T > &Other)
 
 ~ezScopedRefPointer ()
 Destructor - releases the reference on the ref-counted object (if there is one).
 
void operator= (T *pNewReference)
 Assignment operator, decreases the ref count of the currently referenced object and increases the ref count of the newly assigned object.
 
void operator= (const ezScopedRefPointer< T > &Other)
 Assignment operator, decreases the ref count of the currently referenced object and increases the ref count of the newly assigned object.
 
 operator const T * () const
 Returns the referenced object (may be nullptr).
 
 operator T * ()
 Returns the referenced object (may be nullptr).
 
const T * operator-> () const
 Returns the referenced object (may be nullptr).
 
T * operator-> ()
 Returns the referenced object (may be nullptr)
 

Private Member Functions

void AddReferenceIfValid ()
 Internal helper function to add a reference on the current object (if != nullptr)
 
void ReleaseReferenceIfValid ()
 Internal helper function to release a reference on the current object (if != nullptr)
 

Private Attributes

T * m_pReferencedObject
 Stores a pointer to the referenced object.
 

Detailed Description

template<typename T>
class ezScopedRefPointer< T >

Stores a pointer to a reference counted object and automatically increases / decreases the reference count.


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