LibreOffice Module tools (master) 1
Public Member Functions | Private Attributes | List of all members
tools::WeakReference< reference_type > Class Template Reference

template implementation to hold a weak reference to an instance of type reference_type More...

#include <weakbase.h>

Collaboration diagram for tools::WeakReference< reference_type >:
[legend]

Public Member Functions

 WeakReference ()
 constructs an empty reference More...
 
 WeakReference (reference_type *pReference)
 constructs a reference with a pointer to a class derived from WeakBase More...
 
 WeakReference (const WeakReference< reference_type > &rWeakRef)
 constructs a reference from another reference More...
 
 WeakReference (WeakReference< reference_type > &&rWeakRef)
 move a reference from another reference More...
 
bool is () const
 returns true if the reference object is not null and still alive More...
 
 operator bool () const
 returns true if the reference object is not null and still alive More...
 
reference_type * get () const
 returns the pointer to the reference object or null More...
 
void reset (reference_type *pReference)
 sets this reference to the given object or null More...
 
void reset ()
 resets this reference to null More...
 
reference_type * operator-> () const
 returns the pointer to the reference object or null More...
 
reference_type & operator* () const
 returns a ref to the reference object More...
 
bool operator== (const reference_type *pReferenceObject) const
 returns true if this instance references pReferenceObject More...
 
bool operator== (const WeakReference< reference_type > &handle) const
 returns true if this instance and the given weakref reference the same object More...
 
bool operator!= (const WeakReference< reference_type > &handle) const
 only needed for using this class with stl containers More...
 
bool operator< (const WeakReference< reference_type > &handle) const
 only needed for using this class with stl containers More...
 
bool operator> (const WeakReference< reference_type > &handle) const
 only needed for using this class with stl containers More...
 
WeakReference< reference_type > & operator= (const WeakReference< reference_type > &handle)
 the assignment operator More...
 
WeakReference< reference_type > & operator= (WeakReference< reference_type > &&handle)
 the move assignment operator More...
 

Private Attributes

rtl::Reference< WeakConnectionmpWeakConnection
 

Detailed Description

template<class reference_type>
class tools::WeakReference< reference_type >

template implementation to hold a weak reference to an instance of type reference_type

Definition at line 73 of file weakbase.h.

Constructor & Destructor Documentation

◆ WeakReference() [1/4]

template<class reference_type >
tools::WeakReference< reference_type >::WeakReference
inline

constructs an empty reference

Definition at line 31 of file weakbase.hxx.

◆ WeakReference() [2/4]

template<class reference_type >
tools::WeakReference< reference_type >::WeakReference ( reference_type *  pReference)
inline

constructs a reference with a pointer to a class derived from WeakBase

Definition at line 37 of file weakbase.hxx.

◆ WeakReference() [3/4]

template<class reference_type >
tools::WeakReference< reference_type >::WeakReference ( const WeakReference< reference_type > &  rWeakRef)
inline

constructs a reference from another reference

Definition at line 43 of file weakbase.hxx.

References tools::WeakReference< reference_type >::mpWeakConnection.

◆ WeakReference() [4/4]

template<class reference_type >
tools::WeakReference< reference_type >::WeakReference ( WeakReference< reference_type > &&  rWeakRef)
inline

move a reference from another reference

Definition at line 49 of file weakbase.hxx.

Member Function Documentation

◆ get()

template<class reference_type >
reference_type * tools::WeakReference< reference_type >::get
inline

returns the pointer to the reference object or null

Definition at line 62 of file weakbase.hxx.

◆ is()

template<class reference_type >
bool tools::WeakReference< reference_type >::is
inline

returns true if the reference object is not null and still alive

Definition at line 56 of file weakbase.hxx.

◆ operator bool()

template<class reference_type >
tools::WeakReference< reference_type >::operator bool ( ) const
inline

returns true if the reference object is not null and still alive

Definition at line 92 of file weakbase.h.

◆ operator!=()

template<class reference_type >
bool tools::WeakReference< reference_type >::operator!= ( const WeakReference< reference_type > &  handle) const
inline

only needed for using this class with stl containers

Definition at line 111 of file weakbase.hxx.

References tools::WeakReference< reference_type >::mpWeakConnection.

◆ operator*()

template<class reference_type >
reference_type & tools::WeakReference< reference_type >::operator* ( void  ) const
inline

returns a ref to the reference object

Definition at line 93 of file weakbase.hxx.

References get().

◆ operator->()

template<class reference_type >
reference_type * tools::WeakReference< reference_type >::operator->
inline

returns the pointer to the reference object or null

Definition at line 87 of file weakbase.hxx.

References get().

◆ operator<()

template<class reference_type >
bool tools::WeakReference< reference_type >::operator< ( const WeakReference< reference_type > &  handle) const
inline

only needed for using this class with stl containers

Definition at line 117 of file weakbase.hxx.

References tools::WeakReference< reference_type >::mpWeakConnection.

◆ operator=() [1/2]

template<class reference_type >
WeakReference< reference_type > & tools::WeakReference< reference_type >::operator= ( const WeakReference< reference_type > &  handle)
inline

the assignment operator

Definition at line 129 of file weakbase.hxx.

References tools::WeakReference< reference_type >::mpWeakConnection.

◆ operator=() [2/2]

template<class reference_type >
WeakReference< reference_type > & tools::WeakReference< reference_type >::operator= ( WeakReference< reference_type > &&  handle)
inline

the move assignment operator

Definition at line 138 of file weakbase.hxx.

◆ operator==() [1/2]

template<class reference_type >
bool tools::WeakReference< reference_type >::operator== ( const reference_type *  pReferenceObject) const
inline

returns true if this instance references pReferenceObject

Definition at line 99 of file weakbase.hxx.

◆ operator==() [2/2]

template<class reference_type >
bool tools::WeakReference< reference_type >::operator== ( const WeakReference< reference_type > &  handle) const
inline

returns true if this instance and the given weakref reference the same object

Definition at line 105 of file weakbase.hxx.

References tools::WeakReference< reference_type >::mpWeakConnection.

◆ operator>()

template<class reference_type >
bool tools::WeakReference< reference_type >::operator> ( const WeakReference< reference_type > &  handle) const
inline

only needed for using this class with stl containers

Definition at line 123 of file weakbase.hxx.

References tools::WeakReference< reference_type >::mpWeakConnection.

◆ reset() [1/2]

template<class reference_type >
void tools::WeakReference< reference_type >::reset
inline

resets this reference to null

Definition at line 81 of file weakbase.hxx.

◆ reset() [2/2]

template<class reference_type >
void tools::WeakReference< reference_type >::reset ( reference_type *  pReference)
inline

sets this reference to the given object or null

Definition at line 72 of file weakbase.hxx.

Member Data Documentation

◆ mpWeakConnection

template<class reference_type >
rtl::Reference<WeakConnection> tools::WeakReference< reference_type >::mpWeakConnection
private

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