SOM ParentNumResolve: Difference between revisions
Appearance
Created page with "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=..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
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 | {{DISPLAYTITLE:SOM_ParentNumResolve}} | ||
implement parent method calls. | 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== | ==Syntax== | ||
Line 13: | Line 13: | ||
==Parameters== | ==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"). | ;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. | |||
; 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"). | |||
; 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== | ==Return Code== | ||
==Remarks== | ==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. | 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== | ==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. | 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== | ==Example Code== | ||
Line 39: | Line 36: | ||
(_SOMClass,1); | (_SOMClass,1); | ||
} | } | ||
</PRE> | </PRE> | ||
==Related== | ==Related== | ||
;Functions | |||
* [[somParentNumResolve]] | * [[somParentNumResolve]] | ||
;Methods | |||
* somGetPClsMtabs | * somGetPClsMtabs | ||
[[Category:SOM | [[Category:SOM macro]] |
Latest revision as of 02:04, 6 May 2020
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