Jump to content

SommAfterMethod

From EDM2

Specifies a method that is automatically called after execution of each client Method.

Syntax

SOMMBeforeAfter    receiver;
Environment       *env;
SOMObject          object;
somId              methodId;
void              *returnedvalue;
va_list            ap;

sommAfterMethod(receiver, env, object, methodId, returnedvalue, ap);

Parameters

receiver (SOMMBeforeAfter)

[A pointer to an object (class) of metaclass SOMMBeforeAfter representing the class object that supports the method (such as, "myMethod") for which the "after" method will apply.

env (Environment *)
A pointer where the method can return exception information if an error is encountered. The dispatch method of SOMMBeforeAfter sets this parameter to NULL before dispatching the first sommBeforeMethod.
object (SOMObject)
A pointer to the instance of the receiver on which the method is invoked.
methodId (somId)
The SOM ID of the method (such as, "myMethod") that was invoked.
returnedvalue
A pointer to the value returned by invoking the method ("myMethod") on an object.
ap (va_list)
The list of input arguments to the method ("myMethod").

Returns

rc

Remarks

The sommAfterMethod specifies a method that is automatically called after execution of each client method. The sommAfterMethod method is introduced in the SOMMBeforeAfter metaclass. The default implementation does nothing until it is overridden. The sommAfterMethod method is not called directly by the user. To define the desired "after" method, sommAfterMethod must be overridden in a metaclass that is a subclass (child) of the SOMMBeforeAfter metaclass.

Caution: somFree is among the methods that get before/after behavior, which implies that the following obligation is imposed on the programmer of a sommAfterMethod. Specifically, care must be taken to guard against sommAfterMethod being called after somFree, at which time the object no longer exists.

Original Class

Related Methods