23#ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
24#define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
32#include "com/sun/star/uno/RuntimeException.hpp"
33#include "com/sun/star/uno/XInterface.hpp"
70template<
class interface_type >
88template<
class interface_type >
93 pInterface, interface_type::static_type());
96template<
class interface_type >
97inline interface_type * Reference< interface_type >::iset_throw(
98 interface_type * pInterface )
102 castToXInterface(pInterface)->acquire();
110template<
class interface_type >
117template<
class interface_type >
123template<
class interface_type >
131#if defined LIBO_INTERNAL_ONLY
133#if !defined(__COVERITY__)
134template<
class interface_type >
142template<
class interface_type >
template<
class derived_type >
144 const Reference< derived_type > & rRef,
146 std::is_base_of_v<interface_type, derived_type>
147 && !std::is_same_v<interface_type, XInterface>,
void *>)
156template<
class interface_type >
164template<
class interface_type >
170template<
class interface_type >
176template<
class interface_type >
182template<
class interface_type >
188template<
class interface_type >
195template<
class interface_type >
201template<
class interface_type >
207template<
class interface_type >
214template<
class interface_type >
220template<
class interface_type >
223 _pInterface = castToXInterface( iset_throw( pInterface ) );
227template<
class interface_type >
238template<
class interface_type >
243 castToXInterface(pInterface)->acquire();
248 return (
NULL != pInterface);
251template<
class interface_type >
259 return (
NULL != pInterface);
262template<
class interface_type >
270template<
class interface_type >
277template<
class interface_type >
284template<
class interface_type >
292template<
class interface_type >
305template<
class interface_type >
312template<
class interface_type >
320template<
class interface_type >
324 set( castFromXInterface(
331template<
class interface_type >
338template<
class interface_type >
346template<
class interface_type >
354template<
class interface_type >
362#if defined LIBO_INTERNAL_ONLY
363template<
class interface_type >
368 _pInterface->release();
375template<
class interface_type >
383template<
class interface_type >
391#if defined LIBO_INTERNAL_ONLY
392template<
class interface_type >
template<
class other_type >
398template<
class interface_type >
template<
class other_type >
404template<
class interface_type >
405inline Reference< interface_type > Any::query()
const
407 return Reference< interface_type >(*
this,
UNO_QUERY);
410template<
class interface_type >
457 return (!
operator == ( pInterface ));
470#if defined LIBO_INTERNAL_ONLY
477template<
typename charT,
typename traits> std::basic_ostream<charT, traits> &
488#if defined LIBO_INTERNAL_ONLY
498struct hash<::css::uno::Reference<T>>
500 std::size_t operator()(::css::uno::Reference<T>
const &
s)
const
__sal_NoAcquire
Definition types.h:371
@ SAL_NO_ACQUIRE
definition of a no acquire enum for ctors
Definition types.h:374
#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_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition types.h:352
@ typelib_TypeClass_INTERFACE
type class of interface
Definition typeclass.h:82
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
#define CPPU_DLLPUBLIC
Definition cppudllapi.h:13
CPPU_DLLPUBLIC rtl_uString * cppu_unsatisfied_iset_msg(typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
CPPU_DLLPUBLIC rtl_uString * cppu_unsatisfied_iquery_msg(typelib_TypeDescriptionReference *pType) SAL_THROW_EXTERN_C()
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &o, Any const &any)
Support for Any in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO macros, for example).
Definition Any.hxx:708
UnoReference_NoAcquire
Enum defining UNO_REF_NO_ACQUIRE for setting reference without acquiring a given interface.
Definition Reference.h:56
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
This String class provides base functionality for C++ like Unicode character array handling.
Definition ustring.hxx:172
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< interface_type > & operator=(interface_type *pInterface)
Assignment operator: Acquires given interface pointer and sets reference.
Definition Reference.hxx:347
void clear()
Clears reference, i.e.
Definition Reference.hxx:228
bool set(const Reference< interface_type > &rRef)
Sets the given interface.
Definition Reference.hxx:271
interface_type * get() const
Gets interface pointer.
Definition Reference.h:405
Reference()
Default Constructor: Sets null reference.
Definition Reference.hxx:118
~Reference() COVERITY_NOEXCEPT_FALSE
Destructor: Releases interface if set.
Definition Reference.hxx:111
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 * _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 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