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

  • 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 135
1-124 SOMobjects Base Toolkit: Programmers Reference Manual
somUnregisterClass Method
Purpose
Removes a class object from the SOM run-time class registry.
IDL Syntax
long somUnregisterClass (in SOMClass class);
Note: For backward compatibility, this method does not take an Environment parameter.
Description
The somUnregisterClass method unregisters a SOM class and frees the class object. If
the class was dynamically loaded, it is also unloaded using somUnloadClassFile (which
causes its entire affinity group to be unloaded as well).
Parameters
receiver Usually SOMClassMgrObject (or a pointer to an instance of a
user-supplied subclass of SOMClassMgr).
class A pointer to the class to be unregistered.
Return Value
The somUnregisterClass method returns 0 for a successful completion, or non-zero to
denote failure.
Example
#include <som.h>
void main ()
{
long rc; /* Return code */
SOMClass animalClass;
/* The next 2 lines declare a static form of somId */
string animalClassName = ”Animal”;
somId animalId = &animalClassName;
somEnvironmentNew ();
animalClass = SOMClassMgr_somFindClass (SOMClassMgrObject,
animalId, 0, 0);
if (!animalClass) {
somPrintf (”Could not load class.\n”);
return;
}
rc = SOMClassMgr_somUnregisterClass (SOMClassMgrObject,
animalClass);
if (rc)
somPrintf (”Could not unregister class, error code:
%ld.\n”,
rc);
else
somPrintf (”Class successfully unloaded.\n”);
}
Zobrazit stránku 135
1 2 ... 131 132 133 134 135 136 137 138 139 140 141 ... 423 424

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

Žádné komentáře