20#ifndef INCLUDED_VCL_LAZYDELETE_HXX
21#define INCLUDED_VCL_LAZYDELETE_HXX
25#include <com/sun/star/lang/XComponent.hpp>
60 static void SAL_DLLPRIVATE ImplDeleteOnDeInit();
70 template <
typename T >
76 template <
class... Args >
92 template <
class... Args >
93 std::optional<T>
set(Args&&... args)
95 auto pOld = std::move(
m_pT);
112 template <
typename I>
123 void set (
const css::uno::Reference<I>& r_xNew )
125 css::uno::Reference< css::lang::XComponent> xComponent (
m_xI, css::uno::UNO_QUERY);
127 if (xComponent.is())
try
129 xComponent->dispose();
131 catch( css::uno::Exception& )
static void addDeinitContainer(DeleteOnDeinitBase *i_pContainer)
virtual void doCleanup()=0
DeleteOnDeinit(Args &&... args)
std::optional< T > set(Args &&... args)
DeleteOnDeinit(DeleteOnDeinitFlag)
virtual void doCleanup() override
Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit template class makes sure that a static UNO...
void set(const css::uno::Reference< I > &r_xNew)
DeleteUnoReferenceOnDeinit(css::uno::Reference< I > _xI)
virtual void doCleanup() override
css::uno::Reference< I > m_xI
css::uno::Reference< I > get()