| Home · All Classes · All Namespaces · Modules · Functions · Files

Public Member Functions | Friends
Tp::WeakPtr Class Reference
Utililty classes

The WeakPtr class holds a weak reference to an object managed by SharedPtr. More...

`#include <TelepathyQt/WeakPtr>`

List of all members.

## Public Member Functions

- WeakPtr ()
- WeakPtr (T *d)
- WeakPtr (const WeakPtr< T > &o)
- WeakPtr (const SharedPtr< T > &o)
- ~WeakPtr ()
- bool isNull () const
- bool operator! () const
- operator UnspecifiedBoolType () const
- WeakPtr< T > & operator= (const WeakPtr< T > &o)
- WeakPtr< T > & operator= (const SharedPtr< T > &o)
- void swap (WeakPtr< T > &o)
- SharedPtr< T > toStrongRef () const

## Friends

- uint qHash (const WeakPtr< T > &ptr)

## Detailed Description

The WeakPtr class holds a weak reference to an object managed by SharedPtr.

Tp::WeakPtr is useful for example for breaking reference cycles which would result from using a Tp::SharedPtr for both ends of a pair of mutually linked objects to refer to each other.

See Shared Pointer Usage

## Constructor & Destructor Documentation

Tp::WeakPtr::WeakPtr | ( |  | ) | `[inline]`

Tp::WeakPtr::WeakPtr | ( | T * | d | ) | `[inline, explicit]`

Tp::WeakPtr::WeakPtr | ( | const WeakPtr< T > & | o | ) | `[inline]`

Tp::WeakPtr::WeakPtr | ( | const SharedPtr< T > & | o | ) | `[inline]`

Tp::WeakPtr::~WeakPtr | ( |  | ) | `[inline]`

## Member Function Documentation

bool Tp::WeakPtr::isNull | ( |  | ) | const`[inline]`

bool Tp::WeakPtr::operator! | ( |  | ) | const`[inline]`

Tp::WeakPtr::operator UnspecifiedBoolType | ( |  | ) | const`[inline]`

WeakPtr<T>& Tp::WeakPtr::operator= | ( | const WeakPtr< T > & | o | ) | `[inline]`

WeakPtr<T>& Tp::WeakPtr::operator= | ( | const SharedPtr< T > & | o | ) | `[inline]`

void Tp::WeakPtr::swap | ( | WeakPtr< T > & | o | ) | `[inline]`

SharedPtr<T> Tp::WeakPtr::toStrongRef | ( |  | ) | const`[inline]`

## Friends And Related Function Documentation

uint qHash | ( | const WeakPtr< T > & | ptr | ) | `[friend]`