19 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
20 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
38 class RuntimeException;
71 inline static XInterface * SAL_CALL
iquery( XInterface * pInterface,
const Type & rType );
79 inline static XInterface * SAL_CALL
iquery_throw( XInterface * pInterface,
const Type & rType );
86 XInterface * SAL_CALL
get()
const
93 bool SAL_CALL
is()
const
96 #if defined LIBO_INTERNAL_ONLY
101 explicit operator bool()
const
111 inline bool SAL_CALL
operator == ( XInterface * pInterface )
const;
118 inline bool SAL_CALL
operator != ( XInterface * pInterface )
const;
126 inline bool SAL_CALL
operator == (
const BaseReference & rRef )
const;
133 inline bool SAL_CALL
operator != (
const BaseReference & rRef )
const;
140 inline bool SAL_CALL
operator < (
const BaseReference & rRef )
const;
184 template<
typename T1,
typename T2 >
struct UpCast {
186 template<
bool,
typename U1,
typename >
struct C
189 template<
typename U1,
typename U2 >
struct C< false, U1, U2 >
192 struct S {
char c[2]; };
194 #if defined _MSC_VER && _MSC_VER < 1800
195 static char f(T2 *,
long);
196 static S f(T1 *
const &,
int);
198 template<
typename U >
static char f(T2 *, U);
199 static S f(T1 *,
int);
204 #if defined _MSC_VER && _MSC_VER < 1800
205 operator T1 *
const & ()
const;
207 operator T1 * ()
const;
213 typedef typename C<
sizeof (f(H(), 0)) == 1,
void *,
void >::t t;
216 template<
typename T2 >
struct UpCast< XInterface, T2 > {};
225 template<
class interface_type >
226 class SAL_DLLPUBLIC_RTTI Reference :
public BaseReference
233 inline static XInterface * SAL_CALL iquery( XInterface * pInterface );
240 inline static XInterface * SAL_CALL iquery_throw( XInterface * pInterface );
246 inline static interface_type * SAL_CALL iset_throw( interface_type * pInterface );
259 static interface_type * castFromXInterface(XInterface * p) {
260 return static_cast< interface_type *
>(
static_cast< void *
>(p));
274 static XInterface * castToXInterface(interface_type * p) {
275 return static_cast< XInterface *
>(
static_cast< void *
>(p));
281 static void * SAL_CALL
operator new ( ::size_t nSize )
283 static void SAL_CALL
operator delete (
void * pMem )
285 static void * SAL_CALL
operator new ( ::size_t,
void * pMem )
287 static void SAL_CALL
operator delete (
void *,
void * )
303 inline Reference( const Reference< interface_type > & rRef );
305 #if defined LIBO_INTERNAL_ONLY
310 inline Reference( Reference< interface_type > && rRef ) noexcept;
321 template<
class derived_type >
323 const Reference< derived_type > & rRef,
324 typename detail::UpCast< interface_type, derived_type >::t = 0 );
330 inline Reference( interface_type * pInterface );
373 #ifdef LIBO_INTERNAL_ONLY
425 interface_type * SAL_CALL operator -> ()
const {
426 assert(_pInterface != NULL);
427 return castFromXInterface(_pInterface);
435 interface_type & SAL_CALL operator * ()
const {
436 assert(_pInterface != NULL);
437 return *castFromXInterface(_pInterface);
444 interface_type * SAL_CALL
get()
const
445 {
return castFromXInterface(_pInterface); }
449 inline void SAL_CALL clear();
462 inline bool SAL_CALL set( interface_type * pInterface );
470 inline bool SAL_CALL set( interface_type * pInterface,
__sal_NoAcquire dummy);
529 #ifdef LIBO_INTERNAL_ONLY
582 #if defined LIBO_INTERNAL_ONLY