Bull DPX/20 Podręcznik Użytkownika Strona 133

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 424
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 132
SOM Kernel Reference 1-121
somSubstituteClass Method
Purpose
Causes the somFindClass, somFindClsInFile, and somClassFromId methods to
substitute one class for another.
IDL Syntax
long somSubstituteClass (
in string origClassName,
in string newClassName);
Note: For backward compatibility, this method does not take an Environment parameter.
Description
The somSubstituteClass method causes the somFindClass, somFindClsInFile, and
somClassFromId methods to return the class named newClassName whenever they would
normally return the class named origClassName. This effectively results in class
newClassName replacing or substituting for class origClassName. For example, the
<origClassName>New macro will subsequently create instances of newClassName.
Some restrictions are enforced to ensure that this works well. Both class origClassName
and class newClassName must have been already registered before issuing this method,
and newClassName must be an immediate child of origClassName. In addition (although
not enforced), no instances should exist of either class at the time this method is invoked.
A convenience macro (SOM_SubstituteClass) is provided for C or C++ users. In one
operation, it creates both the old and the new class and then substitutes the new one in
place of the old. The use of both the somSubstituteClass method and the
SOM_SubstituteClass macro is illustrated in the following example.
Parameters
receiver Usually SOMClassMgrObject or a pointer to an instance of a user-defined
subclass of SOMClassMgr.
origClassName
A NULL terminated string containing the old class name.
newClassName
A NULL terminated string containing the new class name.
Return Value
The somSubstituteClass method returns a value of zero to indicate success; a non-zero
value indicates an error was detected.
Przeglądanie stron 132
1 2 ... 128 129 130 131 132 133 134 135 136 137 138 ... 423 424

Komentarze do niniejszej Instrukcji

Brak uwag