Template Class WeakObjectPtr#
Defined in File object.h
Class Documentation#
-
template<typename T>
class WeakObjectPtr# A custom smart pointer for Object.
See also
- Template Parameters:
T – the content data type.
Public Functions
-
inline WeakObjectPtr()#
default constructor
-
inline WeakObjectPtr(std::nullptr_t)#
default constructor
-
inline WeakObjectPtr(const WeakObjectPtr<T> &other)#
copy constructor
- Parameters:
other – The value to be moved
-
inline WeakObjectPtr(const ObjectPtr<T> &other)#
copy constructor
- Parameters:
other – The value to be moved
-
template<typename U>
inline WeakObjectPtr(const WeakObjectPtr<U> &other)# copy constructor
- Parameters:
other – The value to be moved
-
template<typename U>
inline WeakObjectPtr(const ObjectPtr<U> &other)# copy constructor
- Parameters:
other – The value to be moved
-
inline WeakObjectPtr(WeakObjectPtr<T> &&other)#
move constructor
- Parameters:
other – The value to be moved
-
template<typename Y>
inline WeakObjectPtr(WeakObjectPtr<Y> &&other)# move constructor
- Parameters:
other – The value to be moved
-
inline ~WeakObjectPtr()#
destructor
-
inline void swap(WeakObjectPtr<T> &other)#
Swap this array with another Object.
- Parameters:
other – The other Object
-
inline ObjectPtr<T> lock() const#
- Returns:
The internal object pointer if the object is still alive, otherwise nullptr
-
inline void reset()#
reset the content of ptr to be nullptr
-
inline int use_count() const#
- Returns:
The use count of the ptr, for debug purposes
-
inline bool expired() const#
- Returns:
whether the pointer is nullptr