19 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
20 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
23 #include <com/sun/star/uno/RuntimeException.hpp>
24 #include <com/sun/star/uno/XInterface.hpp>
46 XInterface * pInterface,
const Type & rType )
50 Any aRet( pInterface->queryInterface( rType ) );
53 XInterface * pRet =
static_cast< XInterface *
>( aRet.pReserved );
61 template<
class interface_type >
63 XInterface * pInterface )
69 XInterface * pInterface,
const Type & rType )
71 XInterface * pQueried =
iquery( pInterface, rType );
74 throw RuntimeException(
79 template<
class interface_type >
81 XInterface * pInterface )
84 pInterface, interface_type::static_type());
87 template<
class interface_type >
88 inline interface_type * Reference< interface_type >::iset_throw(
89 interface_type * pInterface )
93 castToXInterface(pInterface)->acquire();
96 throw RuntimeException(
102 template<
class interface_type >
106 _pInterface->release();
109 template<
class interface_type >
115 template<
class interface_type >
120 _pInterface->acquire();
123 template<
class interface_type >
template<
class derived_type >
126 typename detail::UpCast< interface_type, derived_type >::t )
128 interface_type * p = rRef.
get();
131 _pInterface->acquire();
134 template<
class interface_type >
137 _pInterface = castToXInterface(pInterface);
139 _pInterface->acquire();
142 template<
class interface_type >
145 _pInterface = castToXInterface(pInterface);
148 template<
class interface_type >
151 _pInterface = castToXInterface(pInterface);
154 template<
class interface_type >
157 _pInterface = iquery( rRef.
get() );
160 template<
class interface_type >
163 _pInterface = iquery( pInterface );
166 template<
class interface_type >
170 ? iquery( static_cast< XInterface * >( rAny.pReserved ) ) : 0);
173 template<
class interface_type >
176 _pInterface = iquery_throw( rRef.
get() );
179 template<
class interface_type >
182 _pInterface = iquery_throw( pInterface );
185 template<
class interface_type >
189 ? static_cast< XInterface * >( rAny.pReserved ) : 0 );
192 template<
class interface_type >
195 _pInterface = castToXInterface( iset_throw( rRef.
get() ) );
198 template<
class interface_type >
201 _pInterface = castToXInterface( iset_throw( pInterface ) );
205 template<
class interface_type >
210 XInterface *
const pOld = _pInterface;
216 template<
class interface_type >
218 interface_type * pInterface )
221 castToXInterface(pInterface)->acquire();
222 XInterface *
const pOld = _pInterface;
223 _pInterface = castToXInterface(pInterface);
226 return (0 != pInterface);
229 template<
class interface_type >
233 XInterface *
const pOld = _pInterface;
234 _pInterface = castToXInterface(pInterface);
237 return (0 != pInterface);
240 template<
class interface_type >
248 template<
class interface_type >
252 return set( castFromXInterface( rRef.
_pInterface ) );
255 template<
class interface_type >
259 return set( castFromXInterface(iquery( pInterface )),
SAL_NO_ACQUIRE );
262 template<
class interface_type >
270 template<
class interface_type >
278 ? static_cast< XInterface * >( rAny.pReserved ) : 0 )),
283 template<
class interface_type >
287 set( castFromXInterface(iquery_throw( pInterface )),
SAL_NO_ACQUIRE );
290 template<
class interface_type >
298 template<
class interface_type >
302 set( castFromXInterface(
305 ? static_cast< XInterface * >( rAny.pReserved ) : 0 )),
309 template<
class interface_type >
316 template<
class interface_type >
324 template<
class interface_type >
326 interface_type * pInterface )
332 template<
class interface_type >
341 template<
class interface_type >
349 template<
class interface_type >
351 XInterface * pInterface )
371 catch (RuntimeException &)
390 catch (RuntimeException &)
399 return (!
operator == ( pInterface ));