1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 module com
{ module sun
{ module star
{ module uno
{
24 /** the server-side interface to a weak object.
28 <p>This interface is proxy to the adapted object.
29 In order to make it possible to have weak references to objects,
30 the XAdapter interface must be implemented to provide
31 a weak adapter for the clients.
33 <h4>Concept of weak referencing:</h4>
36 <p>This module specifies the interfaces for implementing and using
41 <p>The sense of weak references is to hold a reference to an object
42 without affecting the lifetime of the object. That means that a weak
43 reference may become invalid, at any time, if the referenced object dies.
46 <p>The following interfaces describe one way to handle weak references
47 by providing a weak adapter. The weak object has to provide this
48 adapter if anyone wants to hold a weak reference. To separate their
49 lifetimes, the adapter and the original object must not share the same
50 reference counter. The weak reference is in fact only a hard reference
51 to the adapter, which knows - but does not hold - the original object.
52 That means that the implementation and synchronization of weak
53 referencing is the responsibility of the object. The following
54 interfaces are involved in the concept of weak referencing:
60 <dd>is the server-side interface of the referred object. This
61 referred object must support the XAdapter interface.
67 <dd>is a client-side interface which must be implemented by
68 the holder of any weak reference. It is used for notification
69 when the adapted object dies.
75 published
interface XWeak
: com
::sun
::star
::uno
::XInterface
77 /** queries the weak adapter.
81 <p>It is important that the adapter must know, but not hold
82 the adapted object. If the adapted object dies, all references
83 to the adapter have to be notified to release the adapter.
87 com
::sun
::star
::uno
::XAdapter queryAdapter
();
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */