XWeak
From Apache OpenOffice Wiki
< Zh | Documentation
支持 XWeak
的组件可以提供其他对象,以保持其自身上的引用,而无需防止不再需要引用时遭到销毁。因此,可以轻松避免循环引用。专业 UNO - UNO 概念 - UNO 对象的生存期 详细介绍了这个问题。在 Java 中,要从 Java 帮助程序类 com.sun.star.lib.uno.helper.WeakBase
中导出以支持 XWeak。如果 C++ 组件是从一个 ::cppu::Weak...ImplHelperNN
模板类导出的,如 编写 UNO 组件 - C++ 组件 所述,则可以获得 XWeak 支持,并且事实上是自由的。为了保持完整性,下面给出 XWeak
规范。
// module com::sun::star::uno::XWeak
interface XWeak: com::sun::star::uno::XInterface
{
com::sun::star::uno::XAdapter queryAdapter();
};
Content on this page is licensed under the Public Documentation License (PDL). |