SomGetInstancePartSize

This method returns the total size of the instance data structure introduced by a class. Not generally overridden.

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


 * Original Class : SOMClass

Syntax
long somGetInstancePartSize (SOMClass receiver)

Parameters

 * receiver (SOMClass) : A pointer to the class object whose instance data size is desired.

Return Code

 * rc (long) :
 * bytes Returns the size, in bytes, of the instance variables introduced by this class. This does not include the size of instance variables introduced by this class's ancestor or descendent classes.
 * 0  Returns 0 if a class introduces no instance variables.

Remarks
This method returns the amount of space needed in an object of the specified class or any of its subclasses to contain the instance variables introduced by the class.

Example Code
 main { Animal myAnimal; SOMClass animalClass; int instanceSize; int instanceOffset; int instancePartSize;
 * 1) include 

myAnimal = AnimalNew ; animalClass = _somGetClass (myAnimal); instanceSize = _somGetInstanceSize (animalClass); instanceOffset = _somGetInstanceOffset (animalClass); instancePartSize = _somGetInstancePartSize (animalClass); somPrintf ("Instance Size: %d\n", instanceSize); somPrintf ("Instance Offset: %d\n", instanceOffset); somPrintf ("Instance Part Size: %d\n", instancePartSize); _somFree (myAnimal); } /* Output from this program: Instance Size: 8 Instance Offset: 0 Instance Part Size: 4 

Methods

 * somGetInstanceSize