LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/cppuhelper - weakagg.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 2 100.0 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #ifndef _CPPUHELPER_WEAKAGG_HXX_
      20             : #define _CPPUHELPER_WEAKAGG_HXX_
      21             : 
      22             : #include <cppuhelper/weak.hxx>
      23             : #include <com/sun/star/uno/XAggregation.hpp>
      24             : #include "cppuhelperdllapi.h"
      25             : 
      26             : 
      27             : namespace cppu
      28             : {
      29             : 
      30             : /** Base class to implement an UNO object supporting weak references, i.e. the object can be held
      31             :     weakly (by a ::com::sun::star::uno::WeakReference) and aggregation, i.e. the object can be
      32             :     aggregated by another (delegator).
      33             :     This implementation copes with reference counting.  Upon last release(), the virtual dtor
      34             :     is called.
      35             : 
      36             :     @derive
      37             :     Inherit from this class and delegate acquire()/ release() calls.  Re-implement
      38             :     XAggregation::queryInterface().
      39             : */
      40             : class CPPUHELPER_DLLPUBLIC OWeakAggObject
      41             :     : public ::cppu::OWeakObject
      42             :     , public ::com::sun::star::uno::XAggregation
      43             : {
      44             : public:
      45             :     /** Constructor.  No delegator set.
      46             :     */
      47       26410 :     inline OWeakAggObject() SAL_THROW(())
      48       26410 :         {}
      49             : 
      50             :     /** If a delegator is set, then the delegators gets acquired.  Otherwise call is delegated to
      51             :         base class ::cppu::OWeakObject.
      52             :     */
      53             :     virtual void SAL_CALL acquire() throw();
      54             :     /** If a delegator is set, then the delegators gets released.  Otherwise call is delegated to
      55             :         base class ::cppu::OWeakObject.
      56             :     */
      57             :     virtual void SAL_CALL release() throw();
      58             :     /** If a delegator is set, then the delegator is queried for the demanded interface.  If the
      59             :         delegator cannot provide the demanded interface, it calls queryAggregation() on its
      60             :         aggregated objects.
      61             : 
      62             :         @param rType demanded interface type
      63             :         @return demanded type or empty any
      64             :         @see queryAggregation.
      65             :     */
      66             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
      67             :         throw(::com::sun::star::uno::RuntimeException);
      68             : 
      69             :     /** Set the delegator.  The delegator member reference is a weak reference.
      70             : 
      71             :         @param Delegator the object that delegate its queryInterface to this aggregate.
      72             :     */
      73             :     virtual void SAL_CALL setDelegator( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Delegator )
      74             :         throw(::com::sun::star::uno::RuntimeException);
      75             :     /** Called by the delegator or queryInterface. Re-implement this method instead of
      76             :         queryInterface.
      77             : 
      78             :         @see queryInterface
      79             :     */
      80             :     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType )
      81             :         throw(::com::sun::star::uno::RuntimeException);
      82             : 
      83             : protected:
      84             :     /** Virtual dtor. Called when reference count is 0.
      85             : 
      86             :         @attention
      87             :         Despite the fact that a RuntimeException is allowed to be thrown, you must not throw any
      88             :         exception upon destruction!
      89             :     */
      90             :     virtual ~OWeakAggObject() SAL_THROW( (::com::sun::star::uno::RuntimeException) );
      91             : 
      92             :     /** weak reference to delegator.
      93             :     */
      94             :     ::com::sun::star::uno::WeakReferenceHelper xDelegator;
      95             : private:
      96             :     OWeakAggObject( const OWeakAggObject & rObj ) SAL_THROW(());
      97             :     OWeakAggObject & operator = ( const OWeakAggObject & rObj ) SAL_THROW(());
      98             : };
      99             : 
     100             : }
     101             : 
     102             : #endif
     103             : 
     104             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10