Jump to content

somGetParents

From EDM2

This method gets a pointer to a class's parent (direct base) classes. Not generally overridden. Note: For backward compatibility, this method does not take an Environment parameter.

Original Class
SOMClass

Syntax

SOMClassSequence somGetParents (SOMObject receiver)

Parameters

receiver (SOMObject)
A pointer to the class whose parent (base) classes are desired.

Return Code

rc (SOMClassSequence)
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.

Remarks

The somGetparents method returns a sequence containing pointers to the parents of the receiver.

Example Code

/* Note: Dog is a single-inheritance subclass of Animal. */
#include <dog.idl>
main ()
{
   Dog myDog;
   SOMClass dogClass;
   SOMClassSequence parents;
   char *parentName;
   int i;

   myDog = DogNew();
   dogClass = _somGetClass(myDog);
   parents = _somGetPaarents(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
*/

Related

Methods