19 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
20 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
27 #if defined LIBO_INTERNAL_ONLY
28 #include <type_traits>
42 class RuntimeException;
75 inline static XInterface * SAL_CALL
iquery( XInterface * pInterface,
const Type & rType );
83 inline static XInterface * SAL_CALL
iquery_throw( XInterface * pInterface,
const Type & rType );
90 XInterface * SAL_CALL
get()
const
97 bool SAL_CALL
is()
const
100 #if defined LIBO_INTERNAL_ONLY
105 explicit operator bool()
const
115 inline bool SAL_CALL
operator == ( XInterface * pInterface )
const;
122 inline bool SAL_CALL
operator != ( XInterface * pInterface )
const;
130 inline bool SAL_CALL
operator == (
const BaseReference & rRef )
const;
137 inline bool SAL_CALL
operator != (
const BaseReference & rRef )
const;
144 inline bool SAL_CALL
operator < (
const BaseReference & rRef )
const;
178 template<
class interface_type >
179 class SAL_DLLPUBLIC_RTTI Reference :
public BaseReference
186 inline static XInterface * SAL_CALL iquery( XInterface * pInterface );
193 inline static XInterface * SAL_CALL iquery_throw( XInterface * pInterface );
199 inline static interface_type * SAL_CALL iset_throw( interface_type * pInterface );
212 static interface_type * castFromXInterface(XInterface * p) {
213 return static_cast< interface_type *
>(
static_cast< void *
>(p));
227 static XInterface * castToXInterface(interface_type * p) {
228 return static_cast< XInterface *
>(
static_cast< void *
>(p));
234 static void * SAL_CALL
operator new ( ::size_t nSize )
236 static void SAL_CALL
operator delete (
void * pMem )
238 static void * SAL_CALL
operator new ( ::size_t,
void * pMem )
240 static void SAL_CALL
operator delete (
void *,
void * )
256 inline Reference( const Reference< interface_type > & rRef );
258 #if defined LIBO_INTERNAL_ONLY
263 inline Reference( Reference< interface_type > && rRef ) noexcept;
273 template<
class derived_type >
275 const Reference< derived_type > & rRef,
277 std::is_base_of_v<interface_type, derived_type>
278 && !std::is_same_v<interface_type, XInterface>,
void *> =
nullptr);
285 inline Reference( interface_type * pInterface );
328 #ifdef LIBO_INTERNAL_ONLY
380 interface_type * SAL_CALL operator -> ()
const {
381 assert(_pInterface != NULL);
382 return castFromXInterface(_pInterface);
390 interface_type & SAL_CALL operator * ()
const {
391 assert(_pInterface != NULL);
392 return *castFromXInterface(_pInterface);
399 interface_type * SAL_CALL
get()
const
400 {
return castFromXInterface(_pInterface); }
404 inline void SAL_CALL clear();
417 inline bool SAL_CALL set( interface_type * pInterface );
425 inline bool SAL_CALL set( interface_type * pInterface,
__sal_NoAcquire dummy);
484 #ifdef LIBO_INTERNAL_ONLY
537 #if defined LIBO_INTERNAL_ONLY