Bull DPX/20 Guia do Utilizador Página 119

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 424
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 118
SOM Kernel Reference 1-107
somClassFromId Method
Purpose
Finds a class object, given its somId, if it already exists. Does not load the class.
IDL Syntax
SOMClass somClassFromId (in somId classId);
Note: For backward compatibility, this method does not take an Environment parameter.
Description
Finds a class object, given its somId, if it already exists. Does not load the class.
Use the somClassFromId method instead of somFindClass when you do not want the
class to be automatically loaded if it does not already exist in the current process.
Parameters
receiver Usually SOMClassMgrObject (or a pointer to an instance of a
user-supplied subclass of SOMClassMgr).
classId The somId of the class. This can be obtained from the name of the class
using the somIdFromString function.
Return Value
Returns a pointer to the class, or NULL if the class object does not yet exist.
C Example
#include <som.h>
main () {
SOMClass myClass;
char *myClassName = ”Animal”;
somId animalId;
somEnvironmentNew ();
animalId = somIdFromString (myClassName);
myClass = SOMClassMgr_somClassFromId (SOMClassMgrObject,
animalId);
if (!myClass)
somPrintf (”Class %s has not been loaded.\n”, myClassName);
SOMFree (animalId);
}
This program produces the following output:
Class Animal has not yet been loaded.
Original Class
SOMClassMgr
Related Information
Methods: somFindClass, somFindClsInFile
Vista de página 118
1 2 ... 114 115 116 117 118 119 120 121 122 123 124 ... 423 424

Comentários a estes Manuais

Sem comentários