LibreOffice: cppuhelper/weakagg.hxx Source File

LibreOffice LibreOffice 7.1 SDK C/C++ API Reference

weakagg.hxx
Go to the documentation of this file.
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 INCLUDED_CPPUHELPER_WEAKAGG_HXX
20#define INCLUDED_CPPUHELPER_WEAKAGG_HXX
21
22#include "cppuhelper/weak.hxx"
23#include "cppuhelper/weakref.hxx"
24#include "com/sun/star/uno/XAggregation.hpp"
25#include "cppuhelper/cppuhelperdllapi.h"
26
27
28namespace cppu
29{
30
41 class CPPUHELPER_DLLPUBLIC OWeakAggObject
42 : public ::cppu::OWeakObject
43 , public css::uno::XAggregation
44{
45public:
48 OWeakAggObject()
49 {}
50
54 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
58 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
67 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) SAL_OVERRIDE;
68
73 virtual void SAL_CALL setDelegator( const css::uno::Reference< css::uno::XInterface > & Delegator ) SAL_OVERRIDE;
79 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) SAL_OVERRIDE;
80
81protected:
88 virtual ~OWeakAggObject() SAL_OVERRIDE;
89
92 css::uno::WeakReferenceHelper xDelegator;
93private:
94 OWeakAggObject( const OWeakAggObject & rObj ) SAL_DELETED_FUNCTION;
95 OWeakAggObject & operator = ( const OWeakAggObject & rObj )
96 SAL_DELETED_FUNCTION;
97};
98
99}
100
101#endif
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DELETED_FUNCTION
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:374
SAL_OVERRIDE
#define SAL_OVERRIDE
C++11 "override" feature.
Definition: types.h:387
weak.hxx
weakref.hxx
cppuhelperdllapi.h
CPPUHELPER_DLLPUBLIC
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:28
cppu
Definition: Enterable.hxx:27
cppu::queryInterface
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:39
com::sun::star
Definition: unotype.hxx:35
cppu::OWeakObject
Base class to implement a UNO object supporting weak references, i.e.
Definition: weak.hxx:44
cppu::OWeakAggObject
Base class to implement a UNO object supporting weak references, i.e.
Definition: weakagg.hxx:44
cppu::OWeakAggObject::OWeakAggObject
OWeakAggObject()
Constructor.
Definition: weakagg.hxx:48
cppu::OWeakAggObject::acquire
virtual void acquire() SAL_OVERRIDE
If a delegator is set, then the delegators gets acquired.