1-22 SOMobjects Base Toolkit: Programmer’s Reference Manual
somParentNumResolve Function
Purpose
Obtains a pointer to a procedure that implements a method, given a list of method tables.
Syntax
somMethodPtr somParentNumresolve (
somMethod Tabs parentMtab,
int parentNum,
somMToken M Token);
Methods: somGetMethodData, somGetNthMethodData, somGetRdStub,
somAddStaticMethod, somAddDynamicMethod
Description
The somParentNumResolve function is used to make parent method calls by the C and
C++ language implementation bindings. The somParentNumResolve function returns a
pointer to a procedure for performing the specified method. This pointer is selected from the
specified method table, which is intended to be the method table corresponding to a parent
class.
For C and C++ programmers, the implementation bindings for SOM classes provide
convenient macros for making parent method calls (the “parent_” macros).
Parameters
parentMtab A list of method tables for the parents of the class being implemented. The
SOM API specifies that the list of parent method tables for a given class be
stored in the auxiliary class data structure of the class, in the parentMtab
component. Thus, for the class “XYZ”, the parent method table list is found
in location XYZCClassData.parentMtab. Parent method table lists are
available from class objects by way of the method call somGetPClsMtabs.
parentNum The position of the parent for which the method is to be resolved. The order
of a class’s parents is determined by the order in which they are specified in
the interface statement for the class. (The first parent is number 1.)
mToken The method token for the method to be resolved. The SOM API requires
that if the class “XYZ” introduces the static method foo, then the method
token for foo is found in the class data structure for “XYZ” (called
XYZClassData) in the structure member named foo (that is, at
XYZClassData.foo). Method tokens can also be obtained using the
somGetMethodToken method.
Return Value
A somMethodPtr pointer to a procedure that implements the specified method, selected
from the specified method table.
Kommentare zu diesen Handbüchern