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 >
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 * )
258 #if defined LIBO_INTERNAL_ONLY
273 template<
class derived_type >
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
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:445
__sal_NoAcquire
Definition: types.h:349
#define COVERITY_NOEXCEPT_FALSE
To markup destructors that coverity warns might throw exceptions which won't throw in practice,...
Definition: types.h:333
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be checked.
Definition: types.h:280
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
UnoReference_NoAcquire
Enum defining UNO_REF_NO_ACQUIRE for setting reference without acquiring a given interface.
Definition: Reference.h:52
@ UNO_REF_NO_ACQUIRE
This enum value can be used for creating a reference granting a given interface, i....
Definition: Reference.h:56
UnoReference_QueryThrow
Enum defining UNO_QUERY_THROW for implicit interface query.
Definition: Reference.h:159
@ UNO_QUERY_THROW
This enum value can be used for implicit interface query.
Definition: Reference.h:162
UnoReference_Query
Enum defining UNO_QUERY for implicit interface query.
Definition: Reference.h:150
@ UNO_QUERY
This enum value can be used for implicit interface query.
Definition: Reference.h:153
UnoReference_SetThrow
Enum defining UNO_SET_THROW for throwing if attempts are made to assign a null interface.
Definition: Reference.h:170
@ UNO_SET_THROW
Definition: Reference.h:171
Template reference class for interface type derived from BaseReference.
Definition: Reference.h:180
interface_type * get() const
Gets interface pointer.
Definition: Reference.h:399
C++ class representing an IDL any.
Definition: Any.h:53
This base class serves as a base class for all template reference classes and has been introduced due...
Definition: Reference.h:63
bool operator<(const BaseReference &rRef) const
Needed by some STL containers.
Definition: Reference.hxx:403
static XInterface * iquery(XInterface *pInterface, const Type &rType)
Queries given interface for type rType.
Definition: Reference.hxx:50
bool operator!=(XInterface *pInterface) const
Inequality operator: compares two interfaces Checks if both references are null or refer to the same ...
Definition: Reference.hxx:422
XInterface * _pInterface
the interface pointer
Definition: Reference.h:67
static XInterface * iquery_throw(XInterface *pInterface, const Type &rType)
Queries given interface for type rType.
Definition: Reference.hxx:73
XInterface * get() const
Gets interface pointer.
Definition: Reference.h:90
bool is() const
Checks if reference is null.
Definition: Reference.h:97
bool operator==(XInterface *pInterface) const
Equality operator: compares two interfaces Checks if both references are null or refer to the same ob...
Definition: Reference.hxx:385
C++ class representing an IDL meta type.
Definition: Type.h:55