Bull DPX/20 Uživatelská příručka Strana 155

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 424
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 154
SOM Kernel Reference 1-143
somGetClass Method
Purpose
Returns a pointer to an object’s class object. Not generally overridden.
IDL Syntax
SOMClass somGetClass ( );
Note: For backward compatibility, this method does not take an Environment parameter.
Description
somGetClass obtains a pointer to the receivers class object. The somGetClass method is
typically not overridden.
Important : For C and C++ programmers, SOM provides a SOM_GetClass macro that
performs the same function. This macro should only be used only when absolutely
necessary (that is, when a method call on the object is not possible), since it bypasses
whatever semantics may be intended for the somGetClass method by the implementor of
the receivers class. Even class implementors do not know whether a special semantics for
this method is inherited from ancestor classes. If you are unsure of whether the method or
the macro is appropriate, you should use the method call.
Parameters
receiver A pointer to the object whose class is desired.
Return Value
A pointer to the object’s class object.
C Example
#include <animal.h>
main()
{
Animal myAnimal;
int numMethods;
SOMClass animalClass;
myAnimal = AnimalNew ();
animalClass = _somGetClass (myAnimal);
SOM_Test(animalClass == _Animal);
}
Original Class
SOMObject
Related Information
Macros: SOM_GetClass
Zobrazit stránku 154
1 2 ... 150 151 152 153 154 155 156 157 158 159 160 ... 423 424

Komentáře k této Příručce

Žádné komentáře