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 >
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 >
128 _pInterface = castToXInterface(pInterface);
130 _pInterface->acquire();
133 template<
class interface_type >
136 _pInterface = castToXInterface(pInterface);
139 template<
class interface_type >
142 _pInterface = castToXInterface(pInterface);
145 template<
class interface_type >
148 _pInterface = iquery( rRef.
get() );
151 template<
class interface_type >
154 _pInterface = iquery( pInterface );
157 template<
class interface_type >
161 ? iquery( static_cast< XInterface * >( rAny.
pReserved ) ) : 0);
163 #ifndef EXCEPTIONS_OFF
165 template<
class interface_type >
168 _pInterface = iquery_throw( rRef.
get() );
171 template<
class interface_type >
174 _pInterface = iquery_throw( pInterface );
177 template<
class interface_type >
181 ? static_cast< XInterface * >( rAny.
pReserved ) : 0 );
184 template<
class interface_type >
187 _pInterface = castToXInterface( iset_throw( rRef.
get() ) );
190 template<
class interface_type >
193 _pInterface = castToXInterface( iset_throw( pInterface ) );
198 template<
class interface_type >
203 XInterface *
const pOld = _pInterface;
209 template<
class interface_type >
211 interface_type * pInterface )
SAL_THROW(())
214 castToXInterface(pInterface)->acquire();
215 XInterface *
const pOld = _pInterface;
216 _pInterface = castToXInterface(pInterface);
219 return (0 != pInterface);
222 template<
class interface_type >
226 XInterface *
const pOld = _pInterface;
227 _pInterface = castToXInterface(pInterface);
230 return (0 != pInterface);
233 template<
class interface_type >
241 template<
class interface_type >
245 return set( castFromXInterface( rRef._pInterface ) );
248 template<
class interface_type >
252 return set( castFromXInterface(iquery( pInterface )),
SAL_NO_ACQUIRE );
255 template<
class interface_type >
263 template<
class interface_type >
271 ? static_cast< XInterface * >( rAny.
pReserved ) : 0 )),
275 #ifndef EXCEPTIONS_OFF
277 template<
class interface_type >
281 set( castFromXInterface(iquery_throw( pInterface )),
SAL_NO_ACQUIRE );
284 template<
class interface_type >
292 template<
class interface_type >
296 set( castFromXInterface(
299 ? static_cast< XInterface * >( rAny.
pReserved ) : 0 )),
303 template<
class interface_type >
310 template<
class interface_type >
320 template<
class interface_type >
322 interface_type * pInterface )
SAL_THROW(())
328 template<
class interface_type >
332 set( castFromXInterface( rRef._pInterface ) );
337 template<
class interface_type >
345 template<
class interface_type >
347 XInterface * pInterface )
SAL_THROW( (RuntimeException) )
358 if (_pInterface == pInterface)
360 #ifndef EXCEPTIONS_OFF
368 #ifndef EXCEPTIONS_OFF
370 catch (RuntimeException &)
381 if (_pInterface == rRef._pInterface)
383 #if ! defined EXCEPTIONS_OFF
391 #if ! defined EXCEPTIONS_OFF
393 catch (RuntimeException &)
403 return (!
operator == ( pInterface ));
413 return (!
operator == ( rRef._pInterface ));