diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-03 11:33:14 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-03 11:33:14 +0000 |
commit | 5c392704a42ce9fe4a79cbdf7287665c3ffdb1a4 (patch) | |
tree | 888fd8060e9742304c3b280cc87cb93dd5fbf9b2 /bridges/inc | |
parent | d64dd40fad11ec591639f5509e0f4fde458a084a (diff) |
INTEGRATION: CWS sb10 (1.1.2); FILE ADDED
2004/01/08 13:40:02 sb 1.1.2.1: #114000# Factored out more shared code.
Diffstat (limited to 'bridges/inc')
-rw-r--r-- | bridges/inc/bridges/cpp_uno/shared/vtables.hxx | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/bridges/inc/bridges/cpp_uno/shared/vtables.hxx b/bridges/inc/bridges/cpp_uno/shared/vtables.hxx new file mode 100644 index 000000000000..7d7356305de6 --- /dev/null +++ b/bridges/inc/bridges/cpp_uno/shared/vtables.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * $RCSfile: vtables.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: hr $ $Date: 2004-02-03 12:33:14 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef INCLUDED_BRIDGES_CPP_UNO_SHARED_VTABLES_HXX +#define INCLUDED_BRIDGES_CPP_UNO_SHARED_VTABLES_HXX + +#include "sal/types.h" +#include "typelib/typedescription.h" + +namespace bridges { namespace cpp_uno { namespace shared { + +/** + * Calculate the number of local functions of an interface type. + * + * <p><em>Local</em> functions are those not inherited from any base types. The + * number of <em>functions</em> is potentially larger than the number of + * <em>members</em>, as each read–write attribute member counts as two + * functions.</p> + * + * @param type a non-null pointer to an interface type description, for which + * <code>typelib_typedescription_complete</code> must already have been + * executed + * @return the number of local functions of the given interface type + */ +sal_Int32 getLocalFunctions(typelib_InterfaceTypeDescription const * type); + +/** + * Calculate the number of primary functions of an interface type. + * + * <p>The number of primary functions of an interface is the number of local + * functions of that interface (see <code>getLocalFunctions</code>), plus the + * number of primary functions of that interface's first base type (if it has at + * least one base type).</p> + * + * @param type a pointer to an interface type description; may be null + * @return the number of primary functions of the given interface type, or zero + * if the given interface type is null + */ +sal_Int32 getPrimaryFunctions(typelib_InterfaceTypeDescription * type); + +/** + * Represents a vtable slot of a C++ class. + */ +struct VtableSlot { + /** + * The offset of the vtable. + * + * <p>Multiple-inheritance C++ classes have more than one vtable. The + * offset is logical (<em>not</em> a byte offset), and must be + * non-negative.</p> + */ + sal_Int32 offset; + + /** + * The index within the vtable. + * + * <p>The index is logical (<em>not</em> a byte offset), and must be + * non-negative.</p> + */ + sal_Int32 index; +}; + +/** + * Calculates the vtable slot associated with an interface attribute member. + * + * @param ifcMember a non-null pointer to an interface attribute member + * description + * @return the vtable slot associated with the given interface member + */ +VtableSlot getVtableSlot( + typelib_InterfaceAttributeTypeDescription const * ifcMember); + +/** + * Calculates the vtable slot associated with an interface method member. + * + * @param ifcMember a non-null pointer to an interface method member description + * @return the vtable slot associated with the given interface member + */ +VtableSlot getVtableSlot( + typelib_InterfaceMethodTypeDescription const * ifcMember); + +} } } + +#endif |