23#ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
24#define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
31#if defined LIBO_INTERNAL_ONLY
46class 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;
182template<
class interface_type >
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 )
239 { return ::rtl_allocateMemory( 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 * )
262#if defined LIBO_INTERNAL_ONLY
267#if !defined(__COVERITY__)
279 template<
class derived_type >
283 std::is_base_of_v<interface_type, derived_type>
284 && !std::is_same_v<interface_type, XInterface>,
void *> =
nullptr);
334#ifdef LIBO_INTERNAL_ONLY
386 interface_type * SAL_CALL operator -> ()
const {
396 interface_type & SAL_CALL operator * ()
const {
405 interface_type * SAL_CALL
get()
const
410 inline void SAL_CALL clear();
423 inline bool SAL_CALL
set( interface_type * pInterface );
490#ifdef LIBO_INTERNAL_ONLY
543#if defined LIBO_INTERNAL_ONLY
564#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:492
__sal_NoAcquire
Definition types.h:371
#define COVERITY_NOEXCEPT_FALSE
To markup destructors that coverity warns might throw exceptions which won't throw in practice,...
Definition types.h:367
#define SAL_WARN_UNUSED_RESULT
Use this as markup for functions and methods whose return value must be used.
Definition types.h:288
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
Definition typedescription.hxx:43
UnoReference_NoAcquire
Enum defining UNO_REF_NO_ACQUIRE for setting reference without acquiring a given interface.
Definition Reference.h:56
@ UNO_REF_NO_ACQUIRE
This enum value can be used for creating a reference granting a given interface, i....
Definition Reference.h:60
UnoReference_QueryThrow
Enum defining UNO_QUERY_THROW for implicit interface query.
Definition Reference.h:163
@ UNO_QUERY_THROW
This enum value can be used for implicit interface query.
Definition Reference.h:166
UnoReference_Query
Enum defining UNO_QUERY for implicit interface query.
Definition Reference.h:154
@ UNO_QUERY
This enum value can be used for implicit interface query.
Definition Reference.h:157
UnoReference_SetThrow
Enum defining UNO_SET_THROW for throwing if attempts are made to assign a null interface.
Definition Reference.h:174
@ UNO_SET_THROW
Definition Reference.h:175
Template reference class for interface type derived from BaseReference.
Definition Reference.h:184
static SAL_WARN_UNUSED_RESULT Reference< interface_type > query(const BaseReference &rRef)
Queries given interface reference for type interface_type.
Definition Reference.hxx:376
Reference(const Reference< interface_type > &rRef)
Copy constructor: Copies interface reference.
Definition Reference.hxx:124
bool set(interface_type *pInterface, __sal_NoAcquire dummy)
Sets interface pointer without acquiring it.
Definition Reference.hxx:252
bool set(interface_type *pInterface)
Sets the given interface.
Definition Reference.hxx:239
void set(interface_type *pInterface, UnoReference_SetThrow dummy)
sets the given interface An interface already set will be released.
Definition Reference.hxx:332
void set(Any const &rAny, UnoReference_QueryThrow dummy)
Queries given any for reference interface type (interface_type) and sets it.
Definition Reference.hxx:321
Reference(const Reference< interface_type > &rRef, UnoReference_SetThrow dummy)
Constructor: assigns from the given interface of the same type.
Definition Reference.hxx:215
Reference(XInterface *pInterface, UnoReference_QueryThrow dummy)
Constructor: Queries given interface for reference interface type (interface_type).
Definition Reference.hxx:202
Reference(interface_type *pInterface, UnoReference_SetThrow dummy)
Constructor: assigns from the given interface of the same type.
Definition Reference.hxx:221
static SAL_WARN_UNUSED_RESULT Reference< interface_type > query(XInterface *pInterface)
Queries given interface for type interface_type.
Definition Reference.hxx:384
bool set(const Reference< css::uno::XInterface > &rRef)
Definition Reference.hxx:271
interface_type * get() const
Gets interface pointer.
Definition Reference.h:405
Reference(interface_type *pInterface)
Constructor: Sets given interface pointer.
Definition Reference.hxx:157
Reference()
Default Constructor: Sets null reference.
Definition Reference.hxx:118
void set(const Reference< interface_type > &rRef, UnoReference_SetThrow dummy)
sets the given interface An interface already set will be released.
Definition Reference.hxx:339
Reference(const Any &rAny, UnoReference_QueryThrow dummy)
Constructor: Queries given any for reference interface type (interface_type).
Definition Reference.hxx:208
Reference(interface_type *pInterface, __sal_NoAcquire dummy)
Constructor: Sets given interface pointer without acquiring it.
Definition Reference.hxx:165
C++ class representing an IDL any.
Definition Any.h:58
This base class serves as a base class for all template reference classes and has been introduced due...
Definition Reference.h:67
bool operator<(const BaseReference &rRef) const
Needed by some STL containers.
Definition Reference.hxx:436
static XInterface * iquery(XInterface *pInterface, const Type &rType)
Queries given interface for type rType.
Definition Reference.hxx:54
bool operator!=(XInterface *pInterface) const
Inequality operator: compares two interfaces Checks if both references are null or refer to the same ...
Definition Reference.hxx:455
XInterface * get() const
Gets interface pointer.
Definition Reference.h:94
XInterface * _pInterface
the interface pointer
Definition Reference.h:71
static XInterface * iquery_throw(XInterface *pInterface, const Type &rType)
Queries given interface for type rType.
Definition Reference.hxx:77
bool is() const
Checks if reference is null.
Definition Reference.h:101
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:418
C++ class representing an IDL meta type.
Definition Type.h:59