LibreOffice LibreOffice 4.1 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
com::sun::star::uno::WeakReferenceHelper Class Reference

The WeakReferenceHelper holds a weak reference to an object. More...

`#include <weakref.hxx>`

Inheritance diagram for com::sun::star::uno::WeakReferenceHelper:

## Public Member Functions
| WeakReferenceHelper () throw ()
| Default ctor. More...
| WeakReferenceHelper (const WeakReferenceHelper &rWeakRef) throw ()
| Copy ctor. More...
| WeakReferenceHelper (const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &xInt) throw ()
| Initialize this reference with the hard interface reference xInt. More...
| ~WeakReferenceHelper () throw ()
| Releases this reference. More...
WeakReferenceHelper & | operator= (const WeakReferenceHelper &rWeakRef) throw ()
| Releases this reference and takes over rWeakRef. More...
WeakReferenceHelper & | operator= (const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &xInt) throw ()
| Releases this reference and takes over hard reference xInt. More...
sal_Bool | operator== (const WeakReferenceHelper &rObj) const throw ()
| Returns true if both weak refs reference to the same object. More...
::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > | get () const throw ()
| Gets a hard reference to the object. More...
| operator Reference< XInterface > () const throw ()
| Gets a hard reference to the object. More...
void | clear () throw ()
| Releases this reference. More...

## Detailed Description

The WeakReferenceHelper holds a weak reference to an object.

This object must implement the com::sun::star::uno::XWeak interface. The implementation is thread safe.

## Constructor & Destructor Documentation

com::sun::star::uno::WeakReferenceHelper::WeakReferenceHelper | ( |  | ) |
throw | ( |
| ) |  |
| inline

Default ctor.

Creates an empty weak reference.

com::sun::star::uno::WeakReferenceHelper::WeakReferenceHelper | ( | const WeakReferenceHelper & | rWeakRef | ) |
throw | ( |
| ) |  |

Copy ctor.

Initialize this reference with the same interface as in rWeakRef.

Parameters

  rWeakRef | another weak ref

com::sun::star::uno::WeakReferenceHelper::WeakReferenceHelper | ( | const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & | xInt | ) |
throw | ( |
| ) |  |

Initialize this reference with the hard interface reference xInt.

If the implementation behind xInt does not support XWeak or XInt is null then this reference will be null.

Parameters

  xInt | another hard interface reference

com::sun::star::uno::WeakReferenceHelper::~WeakReferenceHelper | ( |  | ) |
throw | ( |
| ) |  |

Releases this reference.

## Member Function Documentation

void com::sun::star::uno::WeakReferenceHelper::clear | ( |  | ) |
throw | ( |
| ) |  |

Releases this reference.

Since
  UDK 3.2.12

::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > com::sun::star::uno::WeakReferenceHelper::get | ( |  | ) | const
throw | ( |
| ) |  |

Gets a hard reference to the object.

Returns
  hard reference or null, if the weakly referenced interface has gone

com::sun::star::uno::WeakReferenceHelper::operator Reference< XInterface > | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Gets a hard reference to the object.

Returns
  hard reference or null, if the weakly referenced interface has gone

WeakReferenceHelper& com::sun::star::uno::WeakReferenceHelper::operator= | ( | const WeakReferenceHelper & | rWeakRef | ) |
throw | ( |
| ) |  |

Releases this reference and takes over rWeakRef.

Parameters

  rWeakRef | another weak ref

WeakReferenceHelper& com::sun::star::uno::WeakReferenceHelper::operator= | ( | const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & | xInt | ) |
throw | ( |
| ) |  |

Releases this reference and takes over hard reference xInt.

If the implementation behind xInt does not support XWeak or XInt is null, then this reference is null.

Parameters

  xInt | another hard reference

sal_Bool com::sun::star::uno::WeakReferenceHelper::operator== | ( | const WeakReferenceHelper & | rObj | ) | const
throw | ( |
| ) |  |
| inline

Returns true if both weak refs reference to the same object.

Parameters

  rObj | another weak ref

Returns
  true, if both weak refs reference to the same object.

The documentation for this class was generated from the following file:

- cppuhelper/weakref.hxx