somGetClassName

From EDM2
Jump to: navigation, search

This method returns the name of the class of an object. Not generally overridden.

For backward compatibility, this method does not take an Environment parameter.

Original Class 
SOMObject

Syntax

string somGetClassName (somObject receiver)

Parameters

receiver (somObject) 
A pointer to the object whose class name is desired.

Return Code

rc (string) 
Returns a pointer to the name of the class.

Remarks

The somGetClassName method returns a pointer to a zero-terminated string that gives the name of the class of an object.

This method is not generally overridden; it simply invokes somGetName on the class of the receiver. Refer to somGetName for more information on the returned string.

Example Code

#include <animal.h>
main()
{
  Animal myAnimal;
  SOMClass animalClass;
  char *className;

  myAnimal = AnimalNew();
  className = _somGetClassName(myAnimal);
  somPrintf("Class name: %s\n", className);
  _somFree(myAnimal);
}
/*
Output from this program:
Class name:  Animal
*/

Related

Methods