Bull DPX/20 Uživatelská příručka Strana 20

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 424
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 19
1-8 SOMobjects Base Toolkit: Programmers Reference Manual
C++ Example
// SOM IDL for class A and class B
#include <somobj.idl>
module scrExample {
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_screxample_Source
#include <scrExample.xih>
#include <stdio.h>
SOM_Scope void SOMLINK scrExample_Afoo(scrExample_A *somSelf);
{ printf(”1\n”); }
SOM_Scope void SOMLINK scrExample_Bfoo(scrExample_B *somSelf);
{ printf(”2\n”); }
main()
{
scrExample_B *objPtr = new scrExample_B;
// This prints 2
objPtr–>foo();
// This prints 1
((somTD_scrExample_A_foo) /* A necessary method procedure cast
*/
somClassResolve(
_scrExample_A, // the A class object
scrExample_AClassData.foo) // the foo method token
) /* end of method procedure expression */
(objPtr); /* method arguments */
// This prints 2
((somTD_scrExample_A_foo) /* A necessary method procedure cast
*/
somClassResolve(
_scrExample_B, // the B class object
scrExample_AClassData.foo) // the foo method token
) /* end of method procedure expression */
(objPtr); /* method arguments */
}
Related Information
Functions: somResolveByName, somParentResolve, somParentNumResolve,
somResolve
Data Structures: somMethodPtr (sombtype.h), SOMClass (somcls.idl),
somMToken (somapi.h)
Methods: somDispatch, somClassDispatch, somFindMethod, somFindMethodOk,
somGetApplyStub, somGetMethodToken
Macros: SOM_Resolve, SOM_ResolveNoCheck
Zobrazit stránku 19
1 2 ... 15 16 17 18 19 20 21 22 23 24 25 ... 423 424

Komentáře k této Příručce

Žádné komentáře