|
| | WeakRef () noexcept |
| | Default constructor.
|
| |
| | WeakRef (const WeakRef & src) noexcept |
| | Copy constructor.
|
| |
| | WeakRef (WeakRef && src) noexcept |
| | Move constructor.
|
| |
| template<typename T_CastFrom> |
| | WeakRef (const WeakRef< T_CastFrom > & src) noexcept |
| | Copy constructor from different, but castable type.
|
| |
| template<typename T_CastFrom> |
| | WeakRef (WeakRef< T_CastFrom > && src) noexcept |
| | Move constructor from different, but castable type.
|
| |
| template<typename T_CastFrom> |
| | WeakRef (const RefPtr< T_CastFrom > & src) noexcept |
| | Constructor from a RefPtr of the same or a castable type.
|
| |
| | ~WeakRef () noexcept |
| | Destructor.
|
| |
| void | swap (WeakRef & other) noexcept |
| | Swap the contents of two WeakRef<>.
|
| |
| WeakRef & | operator= (const WeakRef & src) noexcept |
| | Copy assignment operator.
|
| |
| WeakRef & | operator= (WeakRef && src) noexcept |
| | Move assignment operator.
|
| |
| template<typename T_CastFrom> |
| WeakRef & | operator= (const WeakRef< T_CastFrom > & src) noexcept |
| | Copy assignment from different, but castable type.
|
| |
| template<typename T_CastFrom> |
| WeakRef & | operator= (WeakRef< T_CastFrom > && src) noexcept |
| | Move assignment from different, but castable type.
|
| |
| template<typename T_CastFrom> |
| WeakRef & | operator= (const RefPtr< T_CastFrom > & src) noexcept |
| | Assignment from a RefPtr of the same or a castable type.
|
| |
| | operator bool () const noexcept |
| | Test whether the WeakRef<> points to any underlying instance.
|
| |
| RefPtr< T_CppObject > | get () const noexcept |
| | Create a strong reference to the underlying object.
|
| |
| void | reset () noexcept |
| | Make this WeakRef empty.
|
| |
template<typename T_CppObject>
class Glib::WeakRef< T_CppObject >
WeakRef<> is a weak reference smartpointer.
WeakRef can store a pointer to any class that is derived from Glib::ObjectBase, and whose reference() method is noexcept. In glibmm and gtkmm, that is anything derived from Glib::ObjectBase.
Unlike a RefPtr, a WeakRef does not contribute to the reference counting of the underlying object.
- Since glibmm 2.46
template <typename T_CppObject>
Test whether the WeakRef<> points to any underlying instance.
Mimics usage of ordinary pointers:
In a multi-threaded program a true return value can become obsolete at any time, even before the caller has a chance to test it, because the underlying instance may lose its last reference in another thread. Use get() if this is not acceptable.