19 #ifndef INCLUDED_UNO_MAPPING_HXX 20 #define INCLUDED_UNO_MAPPING_HXX 60 static void * SAL_CALL
operator new (
size_t nSize )
62 static void SAL_CALL
operator delete (
void * pMem )
64 static void * SAL_CALL
operator new ( size_t,
void * pMem )
66 static void SAL_CALL
operator delete (
void *,
void * )
78 const ::rtl::OUString & rFrom, const ::rtl::OUString & rTo,
113 #if defined LIBO_INTERNAL_ONLY 115 { other._pMapping =
nullptr; }
136 #if defined LIBO_INTERNAL_ONLY 138 if (_pMapping !=
nullptr) {
139 (*_pMapping->release)(_pMapping);
141 _pMapping = other._pMapping;
142 other._pMapping =
nullptr;
152 {
return _pMapping; }
158 bool SAL_CALL
is()
const 159 {
return (_pMapping != NULL); }
163 inline void SAL_CALL
clear();
179 {
return mapInterface( pInterface, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTypeDescr) ); }
188 void * pInterface,
const css::uno::Type & rType )
const;
197 { (*_pMapping->mapInterface)( _pMapping, ppOut, pInterface, pTypeDescr ); }
205 { (*_pMapping->mapInterface)( _pMapping, ppOut, pInterface, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTypeDescr) ); }
213 inline void SAL_CALL
mapInterface(
void ** ppOut,
void * pInterface,
const css::uno::Type & rType )
const;
217 const ::rtl::OUString & rFrom, const ::rtl::OUString & rTo, const ::rtl::OUString & rAddPurpose )
238 : _pMapping( pMapping )
241 (*_pMapping->acquire)( _pMapping );
245 : _pMapping( rMapping._pMapping )
248 (*_pMapping->acquire)( _pMapping );
254 (*_pMapping->release)( _pMapping );
261 (*_pMapping->release)( _pMapping );
269 (*pMapping->acquire)( pMapping );
271 (*_pMapping->release)( _pMapping );
272 _pMapping = pMapping;
277 void ** ppOut,
void * pInterface,
const css::uno::Type & rType )
const 280 TYPELIB_DANGER_GET( &pTD, rType.getTypeLibType() );
283 (*_pMapping->mapInterface)( _pMapping, ppOut, pInterface, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) );
284 TYPELIB_DANGER_RELEASE( pTD );
292 (*_pMapping->mapInterface)( _pMapping, &pOut, pInterface, pTypeDescr );
297 void * pInterface,
const css::uno::Type & rType )
const 326 return (0 != *ppRet);
350 return (NULL != *ppRet);
CPPU_DLLPUBLIC void uno_getMappingByName(struct _uno_Mapping **ppMapping, rtl_uString *pFrom, rtl_uString *pTo, rtl_uString *pAddPurpose) SAL_THROW_EXTERN_C()
Gets an interface mapping from one language environment to another by corresponding environment type ...
struct SAL_DLLPUBLIC_RTTI _typelib_InterfaceTypeDescription typelib_InterfaceTypeDescription
Type description of an interface.
struct SAL_DLLPUBLIC_RTTI _uno_Mapping uno_Mapping
This is the binary specification of a mapping.
bool is() const
Tests if a mapping is set.
Definition: mapping.hxx:158
Template reference class for interface type derived from BaseReference.
Definition: unotype.hxx:39
CPPU_DLLPUBLIC void uno_getMapping(struct _uno_Mapping **ppMapping, struct _uno_Environment *pFrom, struct _uno_Environment *pTo, rtl_uString *pAddPurpose) SAL_THROW_EXTERN_C()
Gets an interface mapping from one environment to another.
C++ wrapper for binary C uno_Environment.
Definition: environment.hxx:49
Type description of an interface.
Definition: typedescription.h:370
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:493
The binary C uno interface description.
Definition: dispatcher.h:61
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:121
uno_Environment * get() const
Provides UNacquired pointer to the set C environment.
Definition: environment.hxx:135
void * mapInterface(void *pInterface, typelib_InterfaceTypeDescription *pTypeDescr) const
Maps an interface from one environment to another.
Definition: mapping.hxx:288
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
bool mapToCpp(Reference< C > *ppRet, uno_Interface *pUnoI)
Deprecated.
Definition: mapping.hxx:318
css::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition: unotype.hxx:320
Mapping & operator=(uno_Mapping *pMapping)
Sets a given mapping.
Definition: mapping.hxx:266
Mapping(const ::rtl::OUString &rFrom, const ::rtl::OUString &rTo, const ::rtl::OUString &rAddPurpose=::rtl::OUString())
Holds a mapping from the specified source to the specified destination by environment type names...
Definition: mapping.hxx:216
#define UNO_LB_UNO
Environment type name for binary C UNO.
Definition: lbnames.h:45
#define OSL_ASSERT(c)
If cond is false, reports an error.
Definition: diagnose.h:82
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of an UNO environment.
void mapInterface(void **ppOut, void *pInterface, typelib_TypeDescription *pTypeDescr) const
Maps an interface from one environment to another.
Definition: mapping.hxx:204
bool mapToUno(uno_Interface **ppRet, const Reference< C > &x)
Deprecated.
Definition: mapping.hxx:342
void mapInterface(void **ppOut, void *pInterface, typelib_InterfaceTypeDescription *pTypeDescr) const
Maps an interface from one environment to another.
Definition: mapping.hxx:196
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
C++ wrapper for C uno_Mapping.
Definition: mapping.hxx:53
void * mapInterface(void *pInterface, typelib_TypeDescription *pTypeDescr) const
Maps an interface from one environment to another.
Definition: mapping.hxx:178
struct SAL_DLLPUBLIC_RTTI _uno_Interface uno_Interface
The binary C uno interface description.
void clear()
Releases a set mapping.
Definition: mapping.hxx:257
Provides simple diagnostic support.
~Mapping()
Destructor.
Definition: mapping.hxx:251
Full type description of a type.
Definition: typedescription.h:71