2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Get a pointer to a method for an object
8 #include <exec/lists.h>
9 #include <proto/exec.h>
11 #include <aros/debug.h>
14 /*****************************************************************************
17 #include <proto/oop.h>
19 AROS_LH3(OOP_MethodFunc
, OOP_GetMethod
,
22 AROS_LHA(OOP_Object
*, obj
, A0
),
23 AROS_LHA(OOP_MethodID
, mid
, D0
),
24 AROS_LHA(OOP_Class
**, classPtr
, A1
),
27 struct Library
*, OOPBase
, 21, OOP
)
30 Get a specific method function for a specific object and
31 a specific interface. This a direct pointer to the method implementation.
32 The pointer should ONLY be used on the object you aquired.
35 obj - pointer to object to get method for.
36 mid - method id for method to get. This may be obtained with GetMethodID()
37 classPtr - A pointer to a location where implementation class pointer will be stored.
38 The obtained method must be called with this class pointer. This pointer
42 The method asked for, or NULL if the method does not exist in
46 !!! Use with EXTREME CAUTION. Very few programs need the extra speed gained
47 by calling a method directly
60 29-10-95 digulla automatically created from
61 intuition_lib.fd and clib/intuition_protos.h
63 *****************************************************************************/
70 /* Get the method from the object's class */
71 ifm
= meta_findmethod((OOP_Object
*)OOP_OCLASS(obj
), mid
, (struct Library
*)OOPBase
);
75 /* Set class pointer */
76 *classPtr
= ifm
->mClass
;
79 D(if (NULL
== ifm
->MethodFunc
) bug("!!! OOP/GetMethod(): IFMethod instance had no methodfunc. This should NEVER happen !!!\n");)
81 return ifm
->MethodFunc
;