WeakRef<> is a weak reference smartpointer.
More...
#include <glibmm/weakref.h>
|
(Note that these are not member functions.)
|
template<class T_CppObject > |
void | swap (WeakRef< T_CppObject >& lhs, WeakRef< T_CppObject >& rhs) |
| Swap the contents of two WeakRef<>. More...
|
|
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.
Unlike a RefPtr, a WeakRef does not contribute to the reference counting of the underlying object.
- Since glibmm 2.46:
template <typename T_CppObject >
Default constructor.
Create an empty weak reference.
template <typename T_CppObject >
template <typename T_CppObject >
template <typename T_CppObject >
template <typename T_CastFrom >
Copy constructor from different, but castable type.
template <typename T_CppObject >
template <typename T_CastFrom >
Move constructor from different, but castable type.
template <typename T_CppObject >
template <typename T_CastFrom >
Constructor from a RefPtr of the same or a castable type.
Create a weak reference from a RefPtr of the same or a castable type. If the RefPtr references nothing, an empty weak reference will be constructed.
template <typename T_CppObject >
template <typename T_CppObject >
template <typename T_CastFrom >
Cast to non-const.
The WeakRef can't be cast with the usual notation so instead you can use
template <typename T_CppObject >
template <typename T_CastFrom >
Dynamic cast to derived class.
The WeakRef can't be cast with the usual notation so instead you can use
template <typename T_CppObject >
template <typename T_CastFrom >
Static cast to derived class.
The WeakRef can't be cast with the usual notation so instead you can use
template <typename T_CppObject >
Create a strong reference to the underlying object.
This is a thread-safe way to acquire a strong reference to the underlying object. If the WeakRef is empty, the returned RefPtr will reference nothing.
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.
template <typename T_CppObject >
Copy assignment operator.
template <typename T_CppObject >
Move assignment operator.
template <typename T_CppObject >
template <typename T_CastFrom >
Copy assignment from different, but castable type.
template <typename T_CppObject >
template <typename T_CastFrom >
Move assignment from different, but castable type.
template <typename T_CppObject >
template <typename T_CastFrom >
Assignment from a RefPtr of the same or a castable type.
template <typename T_CppObject >
template <typename T_CppObject >
Swap the contents of two WeakRef<>.
template <class T_CppObject >
void swap |
( |
WeakRef< T_CppObject >& |
lhs, |
|
|
WeakRef< T_CppObject >& |
rhs |
|
) |
| |
|
related |
Swap the contents of two WeakRef<>.