somResolve - Example Code

// SOM IDL for class A and class B
#include <somobj.idl>
module srExample {
  interface A : SOMObject  { void foo();  implementation
{ callstyle=oidl; }; };
  interface B : A  {  implementation { foo: override; }; };
};

// Example C++ program to implement and test  module scrExample
#define SOM_Module_srexample_Source
#include <srExample.ih>
#include <stdio.h>

SOM_Scope void SOMLINK srExample_Afoo(srExample_A *somSelf);
{  printf("1\n"); }

SOM_Scope void SOMLINK srExample_Bfoo(srExample_B *somSelf);
{ printf("2\n"); }

main()
{
  srExample_B  objPtr = srExample_BNew();

/* This prints  2 */
   ((somTD_srExample_A_foo)
/* this method procedure expression cast is necessary */
   somResolve(objPtr, srExample_AClassData.foo)
   )     /* end of method procedure expression */
    (objPtr);
}


[Back: somResolve - Related Information]
[Next: somResolve - Topics]