LibreOffice Module cppu (master) 1
Typedefs | Functions | Variables
typelib.cxx File Reference
#include <algorithm>
#include <unordered_map>
#include <cassert>
#include <list>
#include <set>
#include <utility>
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <sal/log.hxx>
#include <osl/interlck.h>
#include <osl/mutex.hxx>
#include <rtl/ustring.hxx>
#include <osl/diagnose.h>
#include <typelib/typedescription.h>
#include <uno/any2.h>
#include <o3tl/string_view.hxx>
#include "typelib.hxx"
Include dependency graph for typelib.cxx:

Go to the source code of this file.

Typedefs

typedef std::unordered_map< const sal_Unicode *, typelib_TypeDescriptionReference *, hashStr_Impl, equalStr_Impl > WeakMap_Impl
 
typedef std::pair< void *, typelib_typedescription_Callback > CallbackEntry
 
typedef std::list< CallbackEntryCallbackSet_Impl
 
typedef std::list< typelib_TypeDescription * > TypeDescriptionList_Impl
 

Functions

static sal_Int32 adjustAlignment (sal_Int32 nRequestedAlignment)
 
static sal_Int32 newAlignedSize (sal_Int32 OldSize, sal_Int32 ElementSize, sal_Int32 NeededAlignment)
 Calculate the new size of the structure. More...
 
static sal_Int32 getDescriptionSize (typelib_TypeClass eTypeClass)
 
void SAL_CALL typelib_typedescription_registerCallback (void *pContext, typelib_typedescription_Callback pCallback) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_revokeCallback (void *pContext, typelib_typedescription_Callback pCallback) SAL_THROW_EXTERN_C()
 
static void typelib_typedescription_initTables (typelib_TypeDescription *pTD)
 
void typelib_typedescription_newEmpty (typelib_TypeDescription **ppRet, typelib_TypeClass eTypeClass, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_new (typelib_TypeDescription **ppRet, typelib_TypeClass eTypeClass, rtl_uString *pTypeName, typelib_TypeDescriptionReference *pType, sal_Int32 nMembers, typelib_CompoundMember_Init *pMembers) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newStruct (typelib_TypeDescription **ppRet, rtl_uString *pTypeName, typelib_TypeDescriptionReference *pType, sal_Int32 nMembers, typelib_StructMember_Init *pMembers) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newEnum (typelib_TypeDescription **ppRet, rtl_uString *pTypeName, sal_Int32 nDefaultValue, sal_Int32 nEnumValues, rtl_uString **ppEnumNames, sal_Int32 *pEnumValues) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newInterface (typelib_InterfaceTypeDescription **ppRet, rtl_uString *pTypeName, SAL_UNUSED_PARAMETER sal_uInt32, SAL_UNUSED_PARAMETER sal_uInt16, SAL_UNUSED_PARAMETER sal_uInt16, SAL_UNUSED_PARAMETER sal_uInt32, SAL_UNUSED_PARAMETER sal_uInt32, typelib_TypeDescriptionReference *pBaseInterface, sal_Int32 nMembers, typelib_TypeDescriptionReference **ppMembers) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newMIInterface (typelib_InterfaceTypeDescription **ppRet, rtl_uString *pTypeName, SAL_UNUSED_PARAMETER sal_uInt32, SAL_UNUSED_PARAMETER sal_uInt16, SAL_UNUSED_PARAMETER sal_uInt16, SAL_UNUSED_PARAMETER sal_uInt32, SAL_UNUSED_PARAMETER sal_uInt32, sal_Int32 nBaseInterfaces, typelib_TypeDescriptionReference **ppBaseInterfaces, sal_Int32 nMembers, typelib_TypeDescriptionReference **ppMembers) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newInterfaceMethod (typelib_InterfaceMethodTypeDescription **ppRet, sal_Int32 nAbsolutePosition, sal_Bool bOneWay, rtl_uString *pTypeName, typelib_TypeClass eReturnTypeClass, rtl_uString *pReturnTypeName, sal_Int32 nParams, typelib_Parameter_Init *pParams, sal_Int32 nExceptions, rtl_uString **ppExceptionNames) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newInterfaceAttribute (typelib_InterfaceAttributeTypeDescription **ppRet, sal_Int32 nAbsolutePosition, rtl_uString *pTypeName, typelib_TypeClass eAttributeTypeClass, rtl_uString *pAttributeTypeName, sal_Bool bReadOnly) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute (typelib_InterfaceAttributeTypeDescription **ppRet, sal_Int32 nAbsolutePosition, rtl_uString *pTypeName, typelib_TypeClass eAttributeTypeClass, rtl_uString *pAttributeTypeName, sal_Bool bReadOnly, sal_Int32 nGetExceptions, rtl_uString **ppGetExceptionNames, sal_Int32 nSetExceptions, rtl_uString **ppSetExceptionNames) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_acquire (typelib_TypeDescription *pTypeDescription) SAL_THROW_EXTERN_C()
 
static void typelib_typedescription_destructExtendedMembers (typelib_TypeDescription *pTD)
 
void SAL_CALL typelib_typedescription_release (typelib_TypeDescription *pTD) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_register (typelib_TypeDescription **ppNewDescription) SAL_THROW_EXTERN_C()
 
static bool type_equals (typelib_TypeDescriptionReference const *p1, typelib_TypeDescriptionReference const *p2)
 
sal_Bool SAL_CALL typelib_typedescription_equals (const typelib_TypeDescription *p1, const typelib_TypeDescription *p2) SAL_THROW_EXTERN_C()
 
sal_Int32 typelib_typedescription_getAlignedUnoSize (const typelib_TypeDescription *pTypeDescription, sal_Int32 nOffset, sal_Int32 &rMaxIntegralTypeSize) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescription_getByName (typelib_TypeDescription **ppRet, rtl_uString *pName) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescriptionreference_newByAsciiName (typelib_TypeDescriptionReference **ppTDR, typelib_TypeClass eTypeClass, const char *pTypeName) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescriptionreference_new (typelib_TypeDescriptionReference **ppTDR, typelib_TypeClass eTypeClass, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescriptionreference_acquire (typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescriptionreference_release (typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescriptionreference_getDescription (typelib_TypeDescription **ppRet, typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
 
void typelib_typedescriptionreference_getByName (typelib_TypeDescriptionReference **ppRet, rtl_uString const *pName) SAL_THROW_EXTERN_C()
 
sal_Bool SAL_CALL typelib_typedescriptionreference_equals (const typelib_TypeDescriptionReference *p1, const typelib_TypeDescriptionReference *p2) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_typedescriptionreference_assign (typelib_TypeDescriptionReference **ppDest, typelib_TypeDescriptionReference *pSource) SAL_THROW_EXTERN_C()
 
void SAL_CALL typelib_setCacheSize (sal_Int32) SAL_THROW_EXTERN_C()
 
sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom (typelib_TypeDescriptionReference *pAssignable, typelib_TypeDescriptionReference *pFrom) SAL_THROW_EXTERN_C()
 
sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom (typelib_TypeDescription *pAssignable, typelib_TypeDescription *pFrom) SAL_THROW_EXTERN_C()
 
sal_Bool SAL_CALL typelib_typedescription_complete (typelib_TypeDescription **ppTypeDescr) SAL_THROW_EXTERN_C()
 

Variables

const sal_Int32 nMaxAlignment = static_cast<sal_Int32>( reinterpret_cast<sal_Size>(&reinterpret_cast<AlignSize_Impl *>(16)->dDouble) - 16)
 
constexpr auto nCacheSize = 256
 
const bool s_aAssignableFromTab [11][11]
 

Typedef Documentation

◆ CallbackEntry

typedef std::pair< void *, typelib_typedescription_Callback > CallbackEntry

Definition at line 152 of file typelib.cxx.

◆ CallbackSet_Impl

typedef std::list< CallbackEntry > CallbackSet_Impl

Definition at line 153 of file typelib.cxx.

◆ TypeDescriptionList_Impl

Definition at line 154 of file typelib.cxx.

◆ WeakMap_Impl

typedef std::unordered_map< const sal_Unicode *, typelib_TypeDescriptionReference *, hashStr_Impl, equalStr_Impl > WeakMap_Impl

Definition at line 150 of file typelib.cxx.

Function Documentation

◆ adjustAlignment()

static sal_Int32 adjustAlignment ( sal_Int32  nRequestedAlignment)
static

◆ getDescriptionSize()

static sal_Int32 getDescriptionSize ( typelib_TypeClass  eTypeClass)
static

Definition at line 87 of file typelib.cxx.

Referenced by typelib_typedescription_register().

◆ newAlignedSize()

static sal_Int32 newAlignedSize ( sal_Int32  OldSize,
sal_Int32  ElementSize,
sal_Int32  NeededAlignment 
)
static

Calculate the new size of the structure.

Definition at line 80 of file typelib.cxx.

References adjustAlignment().

Referenced by typelib_typedescription_getAlignedUnoSize().

◆ type_equals()

static bool type_equals ( typelib_TypeDescriptionReference const *  p1,
typelib_TypeDescriptionReference const *  p2 
)
static

◆ typelib_setCacheSize()

void SAL_CALL typelib_setCacheSize ( sal_Int32  )

Definition at line 2278 of file typelib.cxx.

References SAL_THROW_EXTERN_C.

◆ typelib_typedescription_acquire()

void SAL_CALL typelib_typedescription_acquire ( typelib_TypeDescription pTypeDescription)

◆ typelib_typedescription_complete()

sal_Bool SAL_CALL typelib_typedescription_complete ( typelib_TypeDescription **  ppTypeDescr)

Definition at line 2379 of file typelib.cxx.

References SAL_THROW_EXTERN_C.

◆ typelib_typedescription_destructExtendedMembers()

static void typelib_typedescription_destructExtendedMembers ( typelib_TypeDescription pTD)
static

◆ typelib_typedescription_equals()

sal_Bool SAL_CALL typelib_typedescription_equals ( const typelib_TypeDescription p1,
const typelib_TypeDescription p2 
)

Definition at line 1609 of file typelib.cxx.

References SAL_THROW_EXTERN_C, and type_equals().

◆ typelib_typedescription_getAlignedUnoSize()

sal_Int32 typelib_typedescription_getAlignedUnoSize ( const typelib_TypeDescription pTypeDescription,
sal_Int32  nOffset,
sal_Int32 &  rMaxIntegralTypeSize 
)

◆ typelib_typedescription_getByName()

void SAL_CALL typelib_typedescription_getByName ( typelib_TypeDescription **  ppRet,
rtl_uString *  pName 
)

◆ typelib_typedescription_initTables()

static void typelib_typedescription_initTables ( typelib_TypeDescription pTD)
static

Definition at line 301 of file typelib.cxx.

References bReadOnly, i, Init(), maMutex, and SAL_INFO.

◆ typelib_typedescription_isAssignableFrom()

sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom ( typelib_TypeDescription pAssignable,
typelib_TypeDescription pFrom 
)

◆ typelib_typedescription_new()

void SAL_CALL typelib_typedescription_new ( typelib_TypeDescription **  ppRet,
typelib_TypeClass  eTypeClass,
rtl_uString *  pTypeName,
typelib_TypeDescriptionReference *  pType,
sal_Int32  nMembers,
typelib_CompoundMember_Init *  pMembers 
)

◆ typelib_typedescription_newEmpty()

void typelib_typedescription_newEmpty ( typelib_TypeDescription **  ppRet,
typelib_TypeClass  eTypeClass,
rtl_uString *  pTypeName 
)

◆ typelib_typedescription_newEnum()

void SAL_CALL typelib_typedescription_newEnum ( typelib_TypeDescription **  ppRet,
rtl_uString *  pTypeName,
sal_Int32  nDefaultValue,
sal_Int32  nEnumValues,
rtl_uString **  ppEnumNames,
sal_Int32 *  pEnumValues 
)

◆ typelib_typedescription_newExtendedInterfaceAttribute()

void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute ( typelib_InterfaceAttributeTypeDescription **  ppRet,
sal_Int32  nAbsolutePosition,
rtl_uString *  pTypeName,
typelib_TypeClass  eAttributeTypeClass,
rtl_uString *  pAttributeTypeName,
sal_Bool  bReadOnly,
sal_Int32  nGetExceptions,
rtl_uString **  ppGetExceptionNames,
sal_Int32  nSetExceptions,
rtl_uString **  ppSetExceptionNames 
)

◆ typelib_typedescription_newInterface()

void SAL_CALL typelib_typedescription_newInterface ( typelib_InterfaceTypeDescription **  ppRet,
rtl_uString *  pTypeName,
SAL_UNUSED_PARAMETER  sal_uInt32,
SAL_UNUSED_PARAMETER  sal_uInt16,
SAL_UNUSED_PARAMETER  sal_uInt16,
SAL_UNUSED_PARAMETER  sal_uInt32,
SAL_UNUSED_PARAMETER  sal_uInt32,
typelib_TypeDescriptionReference *  pBaseInterface,
sal_Int32  nMembers,
typelib_TypeDescriptionReference **  ppMembers 
)

◆ typelib_typedescription_newInterfaceAttribute()

void SAL_CALL typelib_typedescription_newInterfaceAttribute ( typelib_InterfaceAttributeTypeDescription **  ppRet,
sal_Int32  nAbsolutePosition,
rtl_uString *  pTypeName,
typelib_TypeClass  eAttributeTypeClass,
rtl_uString *  pAttributeTypeName,
sal_Bool  bReadOnly 
)

◆ typelib_typedescription_newInterfaceMethod()

void SAL_CALL typelib_typedescription_newInterfaceMethod ( typelib_InterfaceMethodTypeDescription **  ppRet,
sal_Int32  nAbsolutePosition,
sal_Bool  bOneWay,
rtl_uString *  pTypeName,
typelib_TypeClass  eReturnTypeClass,
rtl_uString *  pReturnTypeName,
sal_Int32  nParams,
typelib_Parameter_Init *  pParams,
sal_Int32  nExceptions,
rtl_uString **  ppExceptionNames 
)

◆ typelib_typedescription_newMIInterface()

void SAL_CALL typelib_typedescription_newMIInterface ( typelib_InterfaceTypeDescription **  ppRet,
rtl_uString *  pTypeName,
SAL_UNUSED_PARAMETER  sal_uInt32,
SAL_UNUSED_PARAMETER  sal_uInt16,
SAL_UNUSED_PARAMETER  sal_uInt16,
SAL_UNUSED_PARAMETER  sal_uInt32,
SAL_UNUSED_PARAMETER  sal_uInt32,
sal_Int32  nBaseInterfaces,
typelib_TypeDescriptionReference **  ppBaseInterfaces,
sal_Int32  nMembers,
typelib_TypeDescriptionReference **  ppMembers 
)

◆ typelib_typedescription_newStruct()

void SAL_CALL typelib_typedescription_newStruct ( typelib_TypeDescription **  ppRet,
rtl_uString *  pTypeName,
typelib_TypeDescriptionReference *  pType,
sal_Int32  nMembers,
typelib_StructMember_Init *  pMembers 
)

Definition at line 778 of file typelib.cxx.

References SAL_THROW_EXTERN_C.

◆ typelib_typedescription_register()

void SAL_CALL typelib_typedescription_register ( typelib_TypeDescription **  ppNewDescription)

◆ typelib_typedescription_registerCallback()

void SAL_CALL typelib_typedescription_registerCallback ( void *  pContext,
typelib_typedescription_Callback  pCallback 
)

Definition at line 276 of file typelib.cxx.

References Init(), and SAL_THROW_EXTERN_C.

◆ typelib_typedescription_release()

void SAL_CALL typelib_typedescription_release ( typelib_TypeDescription pTD)

◆ typelib_typedescription_revokeCallback()

void SAL_CALL typelib_typedescription_revokeCallback ( void *  pContext,
typelib_typedescription_Callback  pCallback 
)

Definition at line 287 of file typelib.cxx.

References Init(), and SAL_THROW_EXTERN_C.

◆ typelib_typedescriptionreference_acquire()

void SAL_CALL typelib_typedescriptionreference_acquire ( typelib_TypeDescriptionReference *  pRef)

◆ typelib_typedescriptionreference_assign()

void SAL_CALL typelib_typedescriptionreference_assign ( typelib_TypeDescriptionReference **  ppDest,
typelib_TypeDescriptionReference *  pSource 
)

◆ typelib_typedescriptionreference_equals()

sal_Bool SAL_CALL typelib_typedescriptionreference_equals ( const typelib_TypeDescriptionReference *  p1,
const typelib_TypeDescriptionReference *  p2 
)

Definition at line 2252 of file typelib.cxx.

References SAL_THROW_EXTERN_C.

◆ typelib_typedescriptionreference_getByName()

void typelib_typedescriptionreference_getByName ( typelib_TypeDescriptionReference **  ppRet,
rtl_uString const *  pName 
)

◆ typelib_typedescriptionreference_getDescription()

void SAL_CALL typelib_typedescriptionreference_getDescription ( typelib_TypeDescription **  ppRet,
typelib_TypeDescriptionReference *  pRef 
)

◆ typelib_typedescriptionreference_isAssignableFrom()

sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom ( typelib_TypeDescriptionReference *  pAssignable,
typelib_TypeDescriptionReference *  pFrom 
)

◆ typelib_typedescriptionreference_new()

void SAL_CALL typelib_typedescriptionreference_new ( typelib_TypeDescriptionReference **  ppTDR,
typelib_TypeClass  eTypeClass,
rtl_uString *  pTypeName 
)

◆ typelib_typedescriptionreference_newByAsciiName()

void SAL_CALL typelib_typedescriptionreference_newByAsciiName ( typelib_TypeDescriptionReference **  ppTDR,
typelib_TypeClass  eTypeClass,
const char *  pTypeName 
)

Definition at line 2032 of file typelib.cxx.

References SAL_THROW_EXTERN_C, and typelib_typedescriptionreference_new().

◆ typelib_typedescriptionreference_release()

void SAL_CALL typelib_typedescriptionreference_release ( typelib_TypeDescriptionReference *  pRef)

Variable Documentation

◆ nCacheSize

constexpr auto nCacheSize = 256
constexpr

◆ nMaxAlignment

const sal_Int32 nMaxAlignment = static_cast<sal_Int32>( reinterpret_cast<sal_Size>(&reinterpret_cast<AlignSize_Impl *>(16)->dDouble) - 16)

Definition at line 68 of file typelib.cxx.

Referenced by adjustAlignment().

◆ s_aAssignableFromTab

const bool s_aAssignableFromTab[11][11]
Initial value:
=
{
{ true, false, false, false, false, false, false, false, false, false, false },
{ false, true, false, false, false, false, false, false, false, false, false },
{ false, false, true, false, false, false, false, false, false, false, false },
{ false, false, true, true, true, false, false, false, false, false, false },
{ false, false, true, true, true, false, false, false, false, false, false },
{ false, false, true, true, true, true, true, false, false, false, false },
{ false, false, true, true, true, true, true, false, false, false, false },
{ false, false, true, true, true, true, true, true, true, false, false },
{ false, false, true, true, true, true, true, true, true, false, false },
{ false, false, true, true, true, false, false, false, false, true, false },
{ false, false, true, true, true, true, true, false, false, true, true }
}

Definition at line 2284 of file typelib.cxx.

Referenced by typelib_typedescriptionreference_isAssignableFrom().