somSelf is a pointer to an object instance of the somSelf class <classname>. Because the same method can be invoked on different objects but implemented differently (polymorphism), a pointer to the object being operated on is required as a parameter in the method invocation. The first parameter in the method invocation always is somSelf. This means that if the method prototype in DOG.IDL for the "bark" method is specified as shown in the following figure, the SOM compiler generates the C-language source-program template file as shown in the next figure:

void bark(long lCount);

SOM_Scope void SOMLINK bark(Dog *somSelf, long lCount)
{
  DogData *somThis = DogGetData(somSelf);
  DogMethodDebug("Dog", "Bark");
}


[Back] [Next]