Bull DPX/20 Podręcznik Użytkownika Strona 109

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 424
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 108
SOM Kernel Reference 1-97
somGetParents Method
Purpose
Gets a pointer to a class’s parent (direct base) classes. Not generally overridden.
IDL Syntax
SOMClassSequence somGetParents ( );
Note: For backward compatibility, this method does not take an Environment parameter.
Description
The somGetParents method returns a sequence containing pointers to the parents of the
receiver.
Parameters
receiver A pointer to the class whose parent (base) classes are desired.
Return Value
The somGetParents method returns a sequence of pointers to the parents of the receiver,
or NULL otherwise (in the case of SOMObject). The sequence of parents is in left-to-right
order.
C Example
/* : Dog is a single–inheritance subclass of Animal. */
#include <dog.h>
main()
{
Dog myDog;
SOMClass dogClass;
SOMClassSequence parents;
char *parentName;
int i;
myDog = DogNew();
dogClass = _somGetClass(myDog);
parents = _somGetParents(dogClass);
for (i=0; i<parents._length; i++)
somPrintf(”–– parent %d is %s\n”, i,
_somGetName(parents._buffer[i]));
_somFree(myDog);
}
/*
Output from this program:
–– parent 0 is Animal
*/
Original Class
SOMClass
Related Information
Methods: somGetClass
Przeglądanie stron 108
1 2 ... 104 105 106 107 108 109 110 111 112 113 114 ... 423 424

Komentarze do niniejszej Instrukcji

Brak uwag