ezEngine  Release 25.03
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)
 

Detailed Description

template<typename T>
class ezScopedRefPointer< T >

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

Note that no automatic deletion etc. happens, this is just to have shared base functionality for reference counted objects. The actual action which, should happen once an object is no longer referenced, obliges to the system that is using the objects.


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