SOM ResolveNoCheck: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:SOM_ResolveNoCheck}} | {{DISPLAYTITLE:SOM_ResolveNoCheck}} | ||
This macro obtains a pointer to a method procedure, without doing consistency check | This macro obtains a pointer to a method procedure, without doing consistency check | ||
==Syntax== | ==Syntax== |
Revision as of 16:08, 11 October 2017
This macro obtains a pointer to a method procedure, without doing consistency check
Syntax
SOMObject objPtr; <token> className; <token> methodName; somMethodPtr rc; rc = SOM_ResolveNoCheck(objPtr, className, methodName);
Parameters
- objPtr (SOMObject)
- A pointer to the object to which the resolved method procedure will be applied.
- className (<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").
- 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
- rc
- (somMethodPtr)
Remarks
The SOM_ResolveNoCheck macro invokes the somResolve function to obtain a pointer to the method procedure that implements the specified method for the specified object. This pointer can be used for efficient repeated invocations of the same method on the same type of objects. The name of the class that introduces the method and the name of the method must be known at compile time. Otherwise, use the somFindMethod or somFindMethodOk method.
The SOM_ResolveNoCheck macro can only be used to obtain a method procedure for a static method (one defined in the IDL specification for a class) and not a method added to a class at run time. Unlike the SOM_Resolve macro, the SOM_ResolveNoCheck macro does not perform any consistency checks on the object pointed to by objPtr.
Expansion
The SOM_ResolveNoCheck macro uses the className and methodName to construct an expression whose value is the method token for the specified method, then invokes the somResolve function. Thus, the macro expands to an expression that represents the entry-point address of the method procedure. This value can be stored in a variable and used for subsequent invocations of the met
Example Code
Animal myObj = AnimalNew(); somMethodProc *procPtr; procPtr = SOM_ResolveNoCheck(myObj, Animal, setSound)
Related
Macros
- SOM_Resolve
Functions
Methods
- somDispatch
- somClassDispatch
- somFindMethod
- somFindMethodOk