SomResolveByName

This function obtains a pointer to the procedure that implements a method for a particular SOM object.

Syntax
 SOMObject      obj; string         methodName; somMethodPtr   rc;

rc = somResolveByName(obj, methodName); 

Parameters

 * obj (SOMObject) : A pointer to the object whose method procedure is required.


 * methodName (string) : A character string representing the name of the method to be resolved.

Return Code

 * rc (somMethodPtr) : A pointer to the somMethodProc (procedure) that implements the specified method for the specified SOM object.

Remarks
This function is used to obtain a pointer to the procedure that implements the specified method for the specified SOM object. The returned procedure pointer can then be used to invoke the method. The C and C++ usage bindings use this function to support name-lookup methods.

This function can be used for invoking dynamic methods. However, the C and C++ usage bindings for SOM classes do not support dynamic methods, thus typedefs necessary for the use of dynamic methods are not available as with static methods. The function somApply provides an alternative mechanism for invoking dynamic methods that avoids the need for casting procedure pointers.

Assuming the static method "setSound," is introduced by the class "Animal", the following example will correctly invoke this method on an instance of "Animal" or one of its descendent classes

Example Code
 example(Animal myAnimal) { somTD_Animal_setSound setSoundProc = somResolveByName(myAnimal, "setSound"); setSoundProc(myAnimal, "Roar!"); } 
 * 1) include 

Data Structures

 * somMethodPtr (sombtype.h)
 * SOMObject (somobj.idl)
 * string (somcorba.h)

Functions

 * somResolve
 * somParentResolve
 * somParentNumResolve
 * somClassResolve

Methods

 * somDispatch
 * somClassDispatch
 * somFindMethod
 * somFindMethodOk

Macros

 * SOM_Resolve
 * SOM_ResolveNoCheck