24#include <typelib/typedescription.h>
40sal_Int32 getVtableCount(typelib_InterfaceTypeDescription
const * type) {
42 for (sal_Int32 i = 0;
i <
type->nBaseTypes; ++
i) {
43 n += getVtableCount(
type->ppBaseTypes[i]);
45 return std::max< sal_Int32 >(
n, 1);
61sal_Int32 mapLocalMemberToLocalFunction(
62 typelib_InterfaceTypeDescription * type, sal_Int32 localMember)
66 sal_Int32 localMemberOffset =
type->nAllMembers -
type->nMembers;
67 sal_Int32 localFunctionOffset =
type->nMapFunctionIndexToMemberIndex
69 return type->pMapMemberIndexToFunctionIndex[localMemberOffset + localMember]
70 - localFunctionOffset;
84 T * member =
const_cast< T *
>(ifcMember);
85 while (member->pBaseRef !=
nullptr) {
86 assert(member->nIndex < member->pInterface->nBaseTypes);
87 for (sal_Int32 i = 0;
i < member->nIndex; ++
i) {
88 slot.
offset += getVtableCount(member->pInterface->ppBaseTypes[i]);
92 &desc, member->pBaseRef);
94 desc !=
nullptr && desc->eTypeClass == member->aBase.aBase.eTypeClass);
95 if (member != ifcMember) {
98 member =
reinterpret_cast< T *
>(desc);
102 member->pInterface->pBaseTypeDescription)
103 + mapLocalMemberToLocalFunction(member->pInterface, member->nIndex);
104 if (member != ifcMember) {
115 return type->nMembers == 0
117 : (
type->nMapFunctionIndexToMemberIndex
118 -
type->pMapMemberIndexToFunctionIndex[
119 type->nAllMembers -
type->nMembers]);
124 for (;
type !=
nullptr;
type =
type->pBaseTypeDescription) {
133 typelib_InterfaceAttributeTypeDescription
const * ifcMember)
135 return doGetVtableSlot(ifcMember);
139 typelib_InterfaceMethodTypeDescription
const * ifcMember)
141 return doGetVtableSlot(ifcMember);
struct _typelib_TypeDescription typelib_TypeDescription
sal_Int32 getLocalFunctions(typelib_InterfaceTypeDescription const *type)
Calculate the number of local functions of an interface type.
sal_Int32 getPrimaryFunctions(typelib_InterfaceTypeDescription *type)
Calculate the number of primary functions of an interface type.
VtableSlot getVtableSlot(typelib_InterfaceAttributeTypeDescription const *ifcMember)
Calculates the vtable slot associated with an interface attribute member.
Represents a vtable slot of a C++ class.
sal_Int32 index
The index within the vtable.
sal_Int32 offset
The offset of the vtable.
void SAL_CALL typelib_typedescription_release(typelib_TypeDescription *pTD) SAL_THROW_EXTERN_C()
sal_Bool SAL_CALL typelib_typedescription_complete(typelib_TypeDescription **ppTypeDescr) SAL_THROW_EXTERN_C()
void SAL_CALL typelib_typedescriptionreference_getDescription(typelib_TypeDescription **ppRet, typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()