ScummVM API documentation
Common::WeakPtr< T > Class Template Reference

#include <ptr.h>

Public Member Functions

 WeakPtr (std::nullptr_t)
 
 WeakPtr (const WeakPtr< T > &r)
 
template<class T2 >
 WeakPtr (const WeakPtr< T2 > &r)
 
template<class T2 >
 WeakPtr (const SharedPtr< T2 > &r)
 
template<class T2 >
WeakPtr< T2 > staticCast () const
 
template<class T2 >
WeakPtr< T2 > dynamicCast () const
 
template<class T2 >
WeakPtr< T2 > constCast () const
 
template<class T2 >
WeakPtr< T2 > reinterpretCast () const
 
SharedPtr< T > lock () const
 
int refCount () const
 
bool expired () const
 
template<class T2 >
bool owner_before (const WeakPtr< T2 > &other) const
 
template<class T2 >
bool owner_before (const SharedPtr< T2 > &other) const
 
WeakPtr< T > & operator= (const WeakPtr< T > &r)
 
template<class T2 >
WeakPtr< T > & operator= (const WeakPtr< T2 > &r)
 
template<class T2 >
WeakPtr< T > & operator= (const SharedPtr< T2 > &r)
 
void reset ()
 
template<class T2 >
void reset (const SharedPtr< T2 > &r)
 
template<class T2 >
void reset (const WeakPtr< T2 > &r)
 

Detailed Description

template<class T>
class Common::WeakPtr< T >

Implements a smart pointer that holds a non-owning ("weak") reference to a pointer. It needs to be converted to a SharedPtr to access it.

Member Function Documentation

◆ staticCast()

template<class T>
template<class T2 >
WeakPtr<T2> Common::WeakPtr< T >::staticCast ( ) const
inline

Performs the equivalent of static_cast to a new pointer type

◆ dynamicCast()

template<class T>
template<class T2 >
WeakPtr<T2> Common::WeakPtr< T >::dynamicCast ( ) const
inline

Performs the equivalent of dynamic_cast to a new pointer type

◆ constCast()

template<class T>
template<class T2 >
WeakPtr<T2> Common::WeakPtr< T >::constCast ( ) const
inline

Performs the equivalent of const_cast to a new pointer type

◆ reinterpretCast()

template<class T>
template<class T2 >
WeakPtr<T2> Common::WeakPtr< T >::reinterpretCast ( ) const
inline

Performs the equivalent of const_cast to a new pointer type

◆ lock()

template<class T>
SharedPtr<T> Common::WeakPtr< T >::lock ( ) const
inline

Creates a SharedPtr that manages the referenced object

◆ refCount()

template<class T>
int Common::WeakPtr< T >::refCount ( ) const
inline

Returns the number of strong references to the object.

◆ expired()

template<class T>
bool Common::WeakPtr< T >::expired ( ) const
inline

Returns whether the referenced object isn't valid

◆ owner_before() [1/2]

template<class T>
template<class T2 >
bool Common::WeakPtr< T >::owner_before ( const WeakPtr< T2 > &  other) const
inline

Returns whether this precedes another weak pointer in owner-based order

◆ owner_before() [2/2]

template<class T>
template<class T2 >
bool Common::WeakPtr< T >::owner_before ( const SharedPtr< T2 > &  other) const
inline

Returns whether this precedes a shared pointer in owner-based order

◆ reset() [1/3]

template<class T>
void Common::WeakPtr< T >::reset ( )
inline

Resets the object to a NULL pointer.

◆ reset() [2/3]

template<class T>
template<class T2 >
void Common::WeakPtr< T >::reset ( const SharedPtr< T2 > &  r)
inline

Resets the object to the specified shared pointer

◆ reset() [3/3]

template<class T>
template<class T2 >
void Common::WeakPtr< T >::reset ( const WeakPtr< T2 > &  r)
inline

Resets the object to the specified weak pointer


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