diff options
author | Herbert Dürr <hdu@apache.org> | 2013-03-12 12:56:12 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2013-03-12 12:56:12 +0000 |
commit | 0a6ba29e675385ce0aa49bb6ecd8d45b7aa0997b (patch) | |
tree | c2ee5531a994440aeb7dbd6710da45d3d168e0ab /cppu/inc | |
parent | a0809605f7612de439f0fc1f007177c6c463d0df (diff) |
reshuffle declarations in typedescription.h to make forward-decls redundant
Notes
Notes:
merged as: fd5a9f20ef7b68439820a385f4527ba94a5a0d03
Diffstat (limited to 'cppu/inc')
-rw-r--r-- | cppu/inc/typelib/typedescription.h | 96 |
1 files changed, 46 insertions, 50 deletions
diff --git a/cppu/inc/typelib/typedescription.h b/cppu/inc/typelib/typedescription.h index b66e80889d73..8e0e7e75750d 100644 --- a/cppu/inc/typelib/typedescription.h +++ b/cppu/inc/typelib/typedescription.h @@ -868,56 +868,6 @@ void SAL_CALL typelib_typedescription_revokeCallback( /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ -/** Returns true, if the type description reference may lose the type description. Otherwise - pType is a valid pointer and cannot be discarded through the lifetime of this reference. - Remark: If the pWeakObj of the type is set too, you can avoid the call of - ...getDescription(...) and use the description directly. pWeakObj == 0 means, that the - description is not initialized. - @internal -*/ -inline bool TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( _typelib_TypeClass eTypeClass ) -{ - return (eTypeClass == typelib_TypeClass_INTERFACE_METHOD) || - (eTypeClass == typelib_TypeClass_INTERFACE_ATTRIBUTE); -} - -/** Gets a description from the reference. The description may not be locked by this call. - You must use the TYPELIB_DANGER_RELEASE macro to release the description fetched with - this macro. - @internal -*/ -inline void TYPELIB_DANGER_GET( typelib_TypeDescription** ppMacroTypeDescr, - typelib_TypeDescriptionReference* pMacroTypeRef ) -{ - void SAL_CALL typelib_typedescriptionreference_getDescription(typelib_TypeDescription**, typelib_TypeDescriptionReference*) SAL_THROW_EXTERN_C(); - - if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pMacroTypeRef->eTypeClass )) - { - typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); - } - else if (!pMacroTypeRef->pType || !pMacroTypeRef->pType->pWeakRef) - { - typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); - if (*ppMacroTypeDescr) - typelib_typedescription_release( *ppMacroTypeDescr ); - } - else - { - *ppMacroTypeDescr = pMacroTypeRef->pType; - } -} - -/** Releases the description previouse fetched by TYPELIB_DANGER_GET. - @internal -*/ -inline void TYPELIB_DANGER_RELEASE( typelib_TypeDescription* pDescription ) -{ - void SAL_CALL typelib_typedescription_release(typelib_TypeDescription*) SAL_THROW_EXTERN_C(); - - if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pDescription->eTypeClass )) - typelib_typedescription_release( pDescription ); -} - /** Creates a type description reference. This is a weak reference not holding the description. If the description is already registered, the previous one is returned. @@ -1154,6 +1104,52 @@ sal_Bool SAL_CALL typelib_typedescription_complete( typelib_TypeDescription ** ppTypeDescr ) SAL_THROW_EXTERN_C(); +/** Returns true, if the type description reference may lose the type description. Otherwise + pType is a valid pointer and cannot be discarded through the lifetime of this reference. + Remark: If the pWeakObj of the type is set too, you can avoid the call of + ...getDescription(...) and use the description directly. pWeakObj == 0 means, that the + description is not initialized. + @internal +*/ +inline bool TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( _typelib_TypeClass eTypeClass ) +{ + return (eTypeClass == typelib_TypeClass_INTERFACE_METHOD) || + (eTypeClass == typelib_TypeClass_INTERFACE_ATTRIBUTE); +} + +/** Gets a description from the reference. The description may not be locked by this call. + You must use the TYPELIB_DANGER_RELEASE macro to release the description fetched with + this macro. + @internal +*/ +inline void TYPELIB_DANGER_GET( typelib_TypeDescription** ppMacroTypeDescr, + typelib_TypeDescriptionReference* pMacroTypeRef ) +{ + if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pMacroTypeRef->eTypeClass )) + { + typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); + } + else if (!pMacroTypeRef->pType || !pMacroTypeRef->pType->pWeakRef) + { + typelib_typedescriptionreference_getDescription( ppMacroTypeDescr, pMacroTypeRef ); + if (*ppMacroTypeDescr) + typelib_typedescription_release( *ppMacroTypeDescr ); + } + else + { + *ppMacroTypeDescr = pMacroTypeRef->pType; + } +} + +/** Releases the description previouse fetched by TYPELIB_DANGER_GET. + @internal +*/ +inline void TYPELIB_DANGER_RELEASE( typelib_TypeDescription* pDescription ) +{ + if (TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( pDescription->eTypeClass )) + typelib_typedescription_release( pDescription ); +} + #ifdef __cplusplus } #endif |