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

Public Member Functions | Friends | List of all members
Tp::WeakPtr< T > Class Template Reference
Utililty classes

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

`#include <TelepathyQt/WeakPtr>`

## 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

### template<class T>
class Tp::WeakPtr< T >

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

## § WeakPtr() [1/4]

template<class T>

Tp::WeakPtr< T >::WeakPtr | ( |  | ) |

inline

## § WeakPtr() [2/4]

template<class T>

Tp::WeakPtr< T >::WeakPtr | ( | T * | d | ) |

inline explicit

## § WeakPtr() [3/4]

template<class T>

Tp::WeakPtr< T >::WeakPtr | ( | const WeakPtr< T > & | o | ) |

inline

## § WeakPtr() [4/4]

template<class T>

Tp::WeakPtr< T >::WeakPtr | ( | const SharedPtr< T > & | o | ) |

inline

## § ~WeakPtr()

template<class T>

Tp::WeakPtr< T >::~WeakPtr | ( |  | ) |

inline

## Member Function Documentation

## § isNull()

template<class T>

bool Tp::WeakPtr< T >::isNull | ( |  | ) | const

inline

## § operator!()

template<class T>

bool Tp::WeakPtr< T >::operator! | ( |  | ) | const

inline

## § operator UnspecifiedBoolType()

template<class T>

Tp::WeakPtr< T >::operator UnspecifiedBoolType | ( |  | ) | const

inline

## § operator=() [1/2]

template<class T>

WeakPtr<T>& Tp::WeakPtr< T >::operator= | ( | const WeakPtr< T > & | o | ) |

inline

## § operator=() [2/2]

template<class T>

WeakPtr<T>& Tp::WeakPtr< T >::operator= | ( | const SharedPtr< T > & | o | ) |

inline

## § swap()

template<class T>

void Tp::WeakPtr< T >::swap | ( | WeakPtr< T > & | o | ) |

inline

## § toStrongRef()

template<class T>

SharedPtr<T> Tp::WeakPtr< T >::toStrongRef | ( |  | ) | const

inline

## Friends And Related Function Documentation

## § qHash

template<class T>

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

friend