Bull DPX/20 Betriebsanweisung Seite 14

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 424
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 13
1-2 SOMobjects Base Toolkit: Programmers Reference Manual
somApply Function
Purpose
Invokes an apply stub. Apply stubs are never invoked directly by SOM users, the somApply
function must be used instead.
Syntax
boolean somApply (
SOMObject objPtr,
somToken *retVal,
somMethodDataPtr mdPtr,
va_list args);
Description
somApply provides a single uniform interface through which it is possible to call any
method procedure. The interface is based on the caller passing: the object to which the
method procedure is to be applied; a return address for the method result; a
somMethodDataPtr indicating the desired method procedure; and an ANSI standard va_list
structure containing the method procedure arguments. Different method procedures expect
different argument types and return different result types, so the purpose of somApply is to
select an apply stub appropriate for the specific method involved, according to the supplied
method data, and then call this apply stub. The apply stub removes the arguments from the
va_list, calls the method procedure with these arguments, accepts the returned result, and
then copies this result to the location pointed to by retVal.
The method procedure used by the apply stub is determined by the content of the
somMethodData structure pointed to by mdPtr. The class methods somGetMethodData
and somGetNthMethodData are used to load a somMethodData structure. These
methods resolve static method procedures based on the receiving class’s instance method
table.
The SOM API requires that information necessary for selecting an apply stub be provided
when a new method is registered with its introducing class (by way of the methods
somAddStaticMethod or somAddDynamicMethod). This is required because SOM itself
needs apply stubs when dispatch method resolution is used. C and C++ implementation
bindings for SOM classes support this requirement, but SOM does not terminate execution
if this requirement is not met by a class implementor. Thus, it is possible that there may be
methods for which somApply cannot select an appropriate apply stub. The
somMethodData structure for the method can be inspected before calling somApply to
verify that the method data contains sufficient information to select an appropriate apply
stub: either the applyStub component or the stubInfo component of this structure must be
non-NULL. If these conditions are met, then somApply performs as described previously,
and a TRUE value is returned; otherwise FALSE is returned.
Parameters
objPtr A pointer to the object on which the method procedure is to be invoked.
retVal A pointer to the memory region into which the result returned by the method
procedure is to be copied. This pointer cannot be null (even in the case of
method procedures whose returned result is void).
mdPtr A pointer to the somMethodData structure that describes the method
whose procedure is to be executed by the apply stub.
Seitenansicht 13
1 2 ... 9 10 11 12 13 14 15 16 17 18 19 ... 423 424

Kommentare zu diesen Handbüchern

Keine Kommentare