LibreOffice Module cppuhelper (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cppu::OWeakObject Class Reference

Base class to implement a UNO object supporting weak references, i.e. More...

#include <weak.hxx>

Inheritance diagram for cppu::OWeakObject:
[legend]
Collaboration diagram for cppu::OWeakObject:
[legend]

Public Member Functions

 OWeakObject ()
 Default Constructor. More...
 
 OWeakObject (const OWeakObject &)
 Dummy copy constructor. More...
 
OWeakObject &SAL_CALL operator= (const OWeakObject &)
 Dummy assignment operator. More...
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::XInterface. More...
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 increasing m_refCount More...
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 decreasing m_refCount More...
 
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter () SAL_OVERRIDE
 XWeak::queryAdapter() implementation. More...
 
SAL_CALL operator css::uno::Reference< css::uno::XInterface > ()
 Cast operator to XInterface reference. More...
 

Protected Member Functions

virtual ~OWeakObject () COVERITY_NOEXCEPT_FALSE
 Virtual dtor. More...
 
void disposeWeakConnectionPoint ()
 disposes and resets m_pWeakConnectionPoint More...
 

Protected Attributes

oslInterlockedCount m_refCount
 reference count. More...
 

Friends

class OWeakConnectionPoint
 

Detailed Description

Base class to implement a UNO object supporting weak references, i.e.

the object can be held weakly (by a css::uno::WeakReference). This implementation copes with reference counting. Upon last release(), the virtual dtor is called.

Derive: \n
Inherit from this class and delegate acquire()/ release() calls.

Definition at line 47 of file weak.hxx.

Constructor & Destructor Documentation

◆ ~OWeakObject()

cppu::OWeakObject::~OWeakObject ( )
protectedvirtual

Virtual dtor.

Attention: \n
Despite the fact that a RuntimeException is allowed to be thrown, you must not throw any exception upon destruction!

Definition at line 250 of file weak.cxx.

◆ OWeakObject() [1/2]

cppu::OWeakObject::OWeakObject ( )
inline

Default Constructor.

Sets the reference count to zero.

Definition at line 100 of file weak.hxx.

References m_refCount, and NULL.

Referenced by cppuhelper::WeakComponentImplHelperBase2::dispose().

◆ OWeakObject() [2/2]

cppu::OWeakObject::OWeakObject ( const OWeakObject )
inline

Dummy copy constructor.

Set the reference count to zero.

Definition at line 108 of file weak.hxx.

References m_refCount, and NULL.

Member Function Documentation

◆ acquire()

void SAL_CALL cppu::OWeakObject::acquire ( )
virtualnoexcept

increasing m_refCount

Reimplemented in cppuhelper::WeakComponentImplHelper2< Ifc >, cppuhelper::ServiceManager, cppuhelper::TypeManager, cppu::OComponentHelper, cppu::WeakImplHelper1< Ifc1 >, cppu::WeakAggImplHelper1< Ifc1 >, cppu::WeakImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >, cppu::WeakAggImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >, cppu::WeakImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >, cppu::WeakAggImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >, cppu::WeakImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >, cppu::WeakAggImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >, cppu::WeakImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >, cppu::WeakAggImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >, cppu::WeakImplHelper2< Ifc1, Ifc2 >, cppu::WeakAggImplHelper2< Ifc1, Ifc2 >, cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 >, cppu::WeakAggImplHelper3< Ifc1, Ifc2, Ifc3 >, cppu::WeakImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >, cppu::WeakAggImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >, cppu::WeakImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >, cppu::WeakAggImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >, cppu::WeakImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >, cppu::WeakAggImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >, cppu::WeakImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >, cppu::WeakAggImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >, cppu::WeakImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >, cppu::WeakAggImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >, cppu::WeakImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >, cppu::WeakAggImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >, and cppu::OWeakAggObject.

Definition at line 217 of file weak.cxx.

References m_refCount.

Referenced by cppu::WeakImplHelper1< Ifc1 >::acquire(), cppu::WeakImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::acquire(), cppu::WeakImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::acquire(), cppu::WeakImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::acquire(), cppu::WeakImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >::acquire(), cppu::WeakImplHelper2< Ifc1, Ifc2 >::acquire(), cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 >::acquire(), cppu::WeakImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::acquire(), cppu::WeakImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::acquire(), cppu::WeakImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::acquire(), cppu::WeakImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::acquire(), cppu::WeakImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::acquire(), cppu::WeakImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::acquire(), and cppu::OWeakAggObject::acquire().

◆ disposeWeakConnectionPoint()

void cppu::OWeakObject::disposeWeakConnectionPoint ( )
protected

disposes and resets m_pWeakConnectionPoint

Precondition
m_refCount equals 0

Definition at line 234 of file weak.cxx.

References m_refCount, p, and SAL_WARN.

Referenced by release().

◆ operator css::uno::Reference< css::uno::XInterface >()

SAL_CALL cppu::OWeakObject::operator css::uno::Reference< css::uno::XInterface > ( )
inline

Cast operator to XInterface reference.

Returns
XInterface reference

Definition at line 148 of file weak.hxx.

◆ operator=()

OWeakObject &SAL_CALL cppu::OWeakObject::operator= ( const OWeakObject )
inline

Dummy assignment operator.

Does not affect reference count.

Returns
this OWeakObject

Definition at line 118 of file weak.hxx.

◆ queryAdapter()

Reference< XAdapter > SAL_CALL cppu::OWeakObject::queryAdapter ( )
virtual

XWeak::queryAdapter() implementation.

Returns
a com::sun::star::uno::XAdapter reference

Definition at line 255 of file weak.cxx.

References cppu::gpWeakMutex, OWeakConnectionPoint, and p.

◆ queryInterface()

Any SAL_CALL cppu::OWeakObject::queryInterface ( const css::uno::Type &  rType)
virtual

Basic queryInterface() implementation supporting com::sun::star::uno::XWeak and com::sun::star::uno::XInterface.

Parameters
rTypedemanded type
Returns
demanded type or empty any

Reimplemented in cppu::OWeakAggObject, cppuhelper::WeakComponentImplHelperBase2, cppuhelper::WeakComponentImplHelper2< Ifc >, cppu::OComponentHelper, cppu::WeakImplHelper1< Ifc1 >, cppu::WeakAggImplHelper1< Ifc1 >, cppu::WeakImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >, cppu::WeakAggImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >, cppu::WeakImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >, cppu::WeakAggImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >, cppu::WeakImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >, cppu::WeakAggImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >, cppu::WeakImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >, cppu::WeakAggImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >, cppu::WeakImplHelper2< Ifc1, Ifc2 >, cppu::WeakAggImplHelper2< Ifc1, Ifc2 >, cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 >, cppu::WeakAggImplHelper3< Ifc1, Ifc2, Ifc3 >, cppu::WeakImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >, cppu::WeakAggImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >, cppu::WeakImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >, cppu::WeakAggImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >, cppu::WeakImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >, cppu::WeakAggImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >, cppu::WeakImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >, cppu::WeakAggImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >, cppu::WeakImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >, cppu::WeakAggImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >, cppu::WeakImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >, and cppu::WeakAggImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >.

Definition at line 209 of file weak.cxx.

References Any, and cppu::queryInterface().

◆ release()

void SAL_CALL cppu::OWeakObject::release ( )
virtualnoexcept

decreasing m_refCount

Reimplemented in cppuhelper::WeakComponentImplHelper2< Ifc >, cppuhelper::ServiceManager, cppuhelper::TypeManager, cppu::OComponentHelper, cppu::WeakImplHelper1< Ifc1 >, cppu::WeakAggImplHelper1< Ifc1 >, cppu::WeakImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >, cppu::WeakAggImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >, cppu::WeakImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >, cppu::WeakAggImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >, cppu::WeakImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >, cppu::WeakAggImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >, cppu::WeakImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >, cppu::WeakAggImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >, cppu::WeakImplHelper2< Ifc1, Ifc2 >, cppu::WeakAggImplHelper2< Ifc1, Ifc2 >, cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 >, cppu::WeakAggImplHelper3< Ifc1, Ifc2, Ifc3 >, cppu::WeakImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >, cppu::WeakAggImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >, cppu::WeakImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >, cppu::WeakAggImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >, cppu::WeakImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >, cppu::WeakAggImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >, cppu::WeakImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >, cppu::WeakAggImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >, cppu::WeakImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >, cppu::WeakAggImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >, cppu::WeakImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >, cppu::WeakAggImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >, and cppu::OWeakAggObject.

Definition at line 223 of file weak.cxx.

References disposeWeakConnectionPoint(), and m_refCount.

Referenced by cppu::WeakImplHelper1< Ifc1 >::release(), cppu::WeakImplHelper10< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10 >::release(), cppu::WeakImplHelper11< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11 >::release(), cppu::WeakImplHelper12< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12 >::release(), cppu::WeakImplHelper13< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13 >::release(), cppu::WeakImplHelper2< Ifc1, Ifc2 >::release(), cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 >::release(), cppu::WeakImplHelper4< Ifc1, Ifc2, Ifc3, Ifc4 >::release(), cppu::WeakImplHelper5< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 >::release(), cppu::WeakImplHelper6< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6 >::release(), cppu::WeakImplHelper7< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7 >::release(), cppu::WeakImplHelper8< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8 >::release(), cppu::WeakImplHelper9< Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9 >::release(), and cppu::OWeakAggObject::release().

Friends And Related Function Documentation

◆ OWeakConnectionPoint

friend class OWeakConnectionPoint
friend

Definition at line 49 of file weak.hxx.

Referenced by queryAdapter().

Member Data Documentation

◆ m_refCount

oslInterlockedCount cppu::OWeakObject::m_refCount
protected

reference count.

Attention: \n
Don't modify manually! Use acquire() and release().

Definition at line 71 of file weak.hxx.

Referenced by acquire(), disposeWeakConnectionPoint(), cppu::OWeakConnectionPoint::queryAdapted(), and release().


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