19 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
20 #define _COM_SUN_STAR_UNO_REFERENCE_HXX_
23 #include <com/sun/star/uno/RuntimeException.hpp>
24 #include <com/sun/star/uno/XInterface.hpp>
38 XInterface * pInterface,
const Type & rType )
43 Any aRet( pInterface->queryInterface( rType ) );
46 XInterface * pRet =
static_cast< XInterface *
>( aRet.pReserved );
54 template<
class interface_type >
56 XInterface * pInterface )
SAL_THROW( (RuntimeException) )
60 #ifndef EXCEPTIONS_OFF
69 XInterface * pInterface,
const Type & rType )
72 XInterface * pQueried = iquery( pInterface, rType );
75 throw RuntimeException(
80 template<
class interface_type >
82 XInterface * pInterface )
SAL_THROW( (RuntimeException) )
85 pInterface, interface_type::static_type());
88 template<
class interface_type >
89 inline interface_type * Reference< interface_type >::iset_throw(
90 interface_type * pInterface )
SAL_THROW( (RuntimeException) )
94 castToXInterface(pInterface)->acquire();
97 throw RuntimeException(
104 template<
class interface_type >
108 _pInterface->release();
111 template<
class interface_type >
117 template<
class interface_type >
120 _pInterface = rRef._pInterface;
122 _pInterface->acquire();
125 template<
class interface_type >
template<
class derived_type >
128 typename detail::UpCast< interface_type, derived_type >::t )
131 interface_type * p = rRef.
get();
134 _pInterface->acquire();
137 template<
class interface_type >
140 _pInterface = castToXInterface(pInterface);
142 _pInterface->acquire();
145 template<
class interface_type >
148 _pInterface = castToXInterface(pInterface);
151 template<
class interface_type >
154 _pInterface = castToXInterface(pInterface);
157 template<
class interface_type >
160 _pInterface = iquery( rRef.
get() );
163 template<
class interface_type >
166 _pInterface = iquery( pInterface );
169 template<
class interface_type >
173 ? iquery( static_cast< XInterface * >( rAny.
pReserved ) ) : 0);
175 #ifndef EXCEPTIONS_OFF
177 template<
class interface_type >
180 _pInterface = iquery_throw( rRef.
get() );
183 template<
class interface_type >
186 _pInterface = iquery_throw( pInterface );
189 template<
class interface_type >
193 ? static_cast< XInterface * >( rAny.
pReserved ) : 0 );
196 template<
class interface_type >
199 _pInterface = castToXInterface( iset_throw( rRef.
get() ) );
202 template<
class interface_type >
205 _pInterface = castToXInterface( iset_throw( pInterface ) );
210 template<
class interface_type >
215 XInterface *
const pOld = _pInterface;
221 template<
class interface_type >
223 interface_type * pInterface )
SAL_THROW(())
226 castToXInterface(pInterface)->acquire();
227 XInterface *
const pOld = _pInterface;
228 _pInterface = castToXInterface(pInterface);
231 return (0 != pInterface);
234 template<
class interface_type >
238 XInterface *
const pOld = _pInterface;
239 _pInterface = castToXInterface(pInterface);
242 return (0 != pInterface);
245 template<
class interface_type >
253 template<
class interface_type >
257 return set( castFromXInterface( rRef._pInterface ) );
260 template<
class interface_type >
264 return set( castFromXInterface(iquery( pInterface )),
SAL_NO_ACQUIRE );
267 template<
class interface_type >
275 template<
class interface_type >
283 ? static_cast< XInterface * >( rAny.
pReserved ) : 0 )),
287 #ifndef EXCEPTIONS_OFF
289 template<
class interface_type >
293 set( castFromXInterface(iquery_throw( pInterface )),
SAL_NO_ACQUIRE );
296 template<
class interface_type >
304 template<
class interface_type >
308 set( castFromXInterface(
311 ? static_cast< XInterface * >( rAny.
pReserved ) : 0 )),
315 template<
class interface_type >
322 template<
class interface_type >
332 template<
class interface_type >
334 interface_type * pInterface )
SAL_THROW(())
340 template<
class interface_type >
344 set( castFromXInterface( rRef._pInterface ) );
349 template<
class interface_type >
357 template<
class interface_type >
359 XInterface * pInterface )
SAL_THROW( (RuntimeException) )
370 if (_pInterface == pInterface)
372 #ifndef EXCEPTIONS_OFF
380 #ifndef EXCEPTIONS_OFF
382 catch (RuntimeException &)
393 if (_pInterface == rRef._pInterface)
395 #if ! defined EXCEPTIONS_OFF
403 #if ! defined EXCEPTIONS_OFF
405 catch (RuntimeException &)
415 return (!
operator == ( pInterface ));
425 return (!
operator == ( rRef._pInterface ));