Jump to content

SomGetNumMethods: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:somGetNumMethods}} This method returns the number of methods available for a class of objects. Not generally overridden. For backward compatibility, this metho..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 8: Line 8:
  long somGetNumMethods (SOMClass receiver)
  long somGetNumMethods (SOMClass receiver)
==Parameters==
==Parameters==
; receiver (SOMClass) : A pointer to the class object whose instance method count is desired.
; receiver (SOMClass) : A pointer to the class object whose instance method count is desired.


==Return Code==
==Return Code==
; rc (long) : Returns the total number of methods that are currently available for the receiving class.
; rc (long) : Returns the total number of methods that are currently available for the receiving class.


==Remarks==
==Remarks==
Line 27: Line 27:
     AnimalNewClass(Animal_MajorVersion, Animal_MinorVersion);
     AnimalNewClass(Animal_MajorVersion, Animal_MinorVersion);
     numMethods = _somGetNumMethods(_Animal);
     numMethods = _somGetNumMethods(_Animal);
     somPrintf("Number of methods supported by class: %d\n",
     somPrintf("Number of methods supported by class: %d\n", numMethods);
                                                numMethods);
}
}
</PRE>
</PRE>

Latest revision as of 13:11, 3 April 2025

This method returns the number of methods available for a class of objects. Not generally overridden.

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

Original Class
SOMClass

Syntax

long somGetNumMethods (SOMClass receiver)

Parameters

receiver (SOMClass)
A pointer to the class object whose instance method count is desired.

Return Code

rc (long)
Returns the total number of methods that are currently available for the receiving class.

Remarks

This method returns the number of methods currently supported by the specified class, including inherited methods (both static and dynamic).

The value that this method returns is the total number of methods currently known to the receiving class as being applicable to its instances. This includes both static and dynamic methods, whether defined in this class or inherited from an ancestor class.

Example Code

#include <animal.h>
main()
{
    long numMethods;

    AnimalNewClass(Animal_MajorVersion, Animal_MinorVersion);
    numMethods = _somGetNumMethods(_Animal);
    somPrintf("Number of methods supported by class: %d\n", numMethods);
}

Related

Methods