23 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
24 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
31 #if defined LIBO_INTERNAL_ONLY
32 #include <type_traits>
46 class RuntimeException;
79 inline static XInterface * SAL_CALL
iquery( XInterface * pInterface,
const Type & rType );
87 inline static XInterface * SAL_CALL
iquery_throw( XInterface * pInterface,
const Type & rType );
94 XInterface * SAL_CALL
get()
const
101 bool SAL_CALL
is()
const
104 #if defined LIBO_INTERNAL_ONLY
109 explicit operator bool()
const
119 inline bool SAL_CALL
operator == ( XInterface * pInterface )
const;
126 inline bool SAL_CALL
operator != ( XInterface * pInterface )
const;
134 inline bool SAL_CALL
operator == (
const BaseReference & rRef )
const;
141 inline bool SAL_CALL
operator != (
const BaseReference & rRef )
const;
148 inline bool SAL_CALL
operator < (
const BaseReference & rRef )
const;
182 template<
class interface_type >
183 class SAL_DLLPUBLIC_RTTI Reference :
public BaseReference
190 inline static XInterface * SAL_CALL iquery( XInterface * pInterface );
197 inline static XInterface * SAL_CALL iquery_throw( XInterface * pInterface );
203 inline static interface_type * SAL_CALL iset_throw( interface_type * pInterface );
216 static interface_type * castFromXInterface(XInterface * p) {
217 return static_cast< interface_type *
>(
static_cast< void *
>(p));
231 static XInterface * castToXInterface(interface_type * p) {
232 return static_cast< XInterface *
>(
static_cast< void *
>(p));
238 static void * SAL_CALL
operator new ( ::size_t nSize )
240 static void SAL_CALL
operator delete (
void * pMem )
242 static void * SAL_CALL
operator new ( ::size_t,
void * pMem )
244 static void SAL_CALL
operator delete (
void *,
void * )
260 inline Reference( const Reference< interface_type > & rRef );
262 #if defined LIBO_INTERNAL_ONLY
267 inline Reference( Reference< interface_type > && rRef ) noexcept;
277 template<
class derived_type >
279 const Reference< derived_type > & rRef,
281 std::is_base_of_v<interface_type, derived_type>
282 && !std::is_same_v<interface_type, XInterface>,
void *> =
nullptr);
289 inline Reference( interface_type * pInterface );
332 #ifdef LIBO_INTERNAL_ONLY
384 interface_type * SAL_CALL operator -> ()
const {
385 assert(_pInterface != NULL);
386 return castFromXInterface(_pInterface);
394 interface_type & SAL_CALL operator * ()
const {
395 assert(_pInterface != NULL);
396 return *castFromXInterface(_pInterface);
403 interface_type * SAL_CALL
get()
const
404 {
return castFromXInterface(_pInterface); }
408 inline void SAL_CALL clear();
421 inline bool SAL_CALL set( interface_type * pInterface );
429 inline bool SAL_CALL set( interface_type * pInterface,
__sal_NoAcquire dummy);
488 #ifdef LIBO_INTERNAL_ONLY
541 #if defined LIBO_INTERNAL_ONLY
562 #if defined LIBO_INTERNAL_ONLY