IPB_Session interface:
FindMatchingFunction method
Description
Finds a function that has the specified argument list.
Syntax
FindMatchingFunction(pbclass cls, LPCTSTR methodName, PBRoutineType rt, LPCTSTR readableSignature)
Argument |
Description |
---|---|
cls |
pbclass containing the method. |
methodName |
The string name of the method in lowercase. |
rt |
Type of the method: PBRT_FUNCTION for function or PBRT_EVENT for event. |
readableSignature |
A comma-separated string listing the types of the method's arguments. The return type of the method is not included in the string. See the Usage section for examples. |
Return Values
pbmethodID.
Examples
This example returns the method ID of a function named uf_test that takes an integer and a double as arguments:
pbclass cls;
pbmethodID mid;
PBCallInfo* ci = new PBCallInfo;
unsigned long ret_val;
cls = Session -> GetClass(myobj);
mid = Session -> FindMatchingFunction(cls, "uf_test",
PBRT_FUNCTION, "int, double");
Session -> InitCallInfo(cls, mid, ci);
Usage
FindMatchingFunction provides an alternative to the GetMethodID function. It requires a list of the function's arguments (the readableSignature) instead of the signature obtained using the pbsig125 tool.
This table shows the readableSignature for each of several functions.
Function prototype |
Signature |
---|---|
|
|
|
|
|
|
|
|
|
|
FindMatchingFunction does not check the access type of the function, so you can use it to obtain the method ID of a private function. GetMethodID cannot obtain the method ID of a private function.