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_LH2(VOID
*, OOP_GetMethod
,
22 AROS_LHA(OOP_Object
*, obj
, A0
),
23 AROS_LHA(OOP_MethodID
, mid
, D0
),
26 struct Library
*, OOPBase
, 21, OOP
)
29 Get a specific method function for a specific object and
30 a specific interface. This a direct pointer to the method implementation.
31 The pointer should ONLY be used on the object you aquired.
34 obj - pointer to object to get method for.
35 mid - method id for method to get. This may be obtained with GetMethodID()
38 The method asked for, or NULL if the method does not exist in
42 !!! Use with EXTREME CAUTION. Very few programs need the extra speed gained
43 by calling a method directly
49 It returns VOID *. I got compiler errors when returning
50 IPTR (*)(Class *, Object *, Msg)
58 29-10-95 digulla automatically created from
59 intuition_lib.fd and clib/intuition_protos.h
61 *****************************************************************************/
68 /* Get the method from the object's class */
69 ifm
= meta_findmethod((OOP_Object
*)OOP_OCLASS(obj
), mid
, (struct Library
*)OOPBase
);
74 if (NULL
== ifm
->MethodFunc
) {
75 D(bug("!!! OOP/GetMethod(): IFMethod instance had no methodfunc. This should NEVER happen !!!\n"));
79 return (VOID
*)ifm
->MethodFunc
;