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
Kommentare zu diesen Handbüchern