SOM ParentNumResolve
Appearance
This macro obtains a pointer to a method procedure from a list of method tables. It is used by C and C++ implementation bindings to implement parent method calls.
Syntax
(<token> introClass; long parentNum; somMethodTab parentMtabs; <token> ) methodName; SOM_ParentNumResolve(introClass, parentNum, parentMtabs, methodName);
Parameters
- introClass ((<token>)
- The name of the class that introduces methodName. This name should be given as a simple token, rather than a quoted string (for example, Animal. rather than "Animal").
- parentNum (long)
- The position of the desired parent. The first (leftmost) parent of a class has position 1.
- parentMtabs (somMethodTab)
- A list of parent method tables acquired by invoking the somGetPClsMtabs method on a class object.
- methodName (<token> ))
- The name of the method to be resolved. This name should be given as a simple token, rather than a quoted string (for example, setSound rather than "setSound").
Return Code
Remarks
This macro invokes the somParentNumResolve function to obtain a pointer to the static method procedure that implements the specified method for the specified parent. The method is specified by indicating the introducing class, IntroClass, and the method name, methodName.
Expansion
The expansion of the macro produces an expression that is appropriately typed for application of the evaluated result to the indicated method's arguments, as illustrated in the Example.
Example Code
#include <somcls.h> main() { SOMClassMgr * cm = somEnvironmentNew(); somMethodTabs mList = _somGetPClsMtabs(_SOMClass); SOM_ParentNumResolve (SOMObject, 1, mList, somDumpSelfInt) (_SOMClass,1); }
Related
Functions
Methods
- somGetPClsMtabs