System::WeakPtr class

WeakPtr class

Subclass of System::SmartPtr which sets itself to weak mode at construction. Please note that this class doesn’t guarantee that its instance will always remain in weak mode as set_Mode() is still accessible. This type is a pointer to manage other object’s deletion. It should be allocated on stack and passed to functions either by value or by const reference.

template<class T>class WeakPtr : public System::SmartPtr<T>
ParameterDescription
TPointee type.

Methods

MethodDescription
expired() constChecks if referenced object was already deleted.
get_weak() constGets referenced object. Asserts that pointer is in weak mode.
operator=(Q&&)Assigns value to weak pointer. Calls into specific assignment operator of SmartPtr_.
operator==(std::nullptr_t) constChecks if weak pointer is null.
WeakPtr(std::nullptr_t)Creates null pointer.
WeakPtr(Pointee_ *)Creates weak pointer to given object.
WeakPtr(const SmartPtr_&)Creates weak pointer referencing same pointer ptr points to.
WeakPtr(const SmartPtr<Q>&)Creates weak pointer referencing same pointer x points to.
WeakPtr(const WeakPtr_&)Copy-constructs weak pointer.
WeakPtr(const WeakPtr<Q>&)Copy-constructs weak pointer.
WeakPtr(SmartPtr_&&)Move-constructs weak pointer.

Typedefs

TypedefDescription
Pointee_Pointed type.
SmartPtr_Alias for corresponding SmartPtr class.
WeakPtr_Alias for self type.

See Also