2 // Mono.ILASM.BaseMethodRef
5 // Ankit Jain <JAnkit@novell.com>
7 // Copyright 2006 Novell, Inc (http://www.novell.com)
12 using System
.Collections
;
14 namespace Mono
.ILASM
{
15 public abstract class BaseMethodRef
{
17 protected BaseTypeRef owner
;
18 protected PEAPI
.CallConv call_conv
;
19 protected BaseTypeRef ret_type
;
20 protected string name
;
21 protected BaseTypeRef
[] param
;
23 protected PEAPI
.Method peapi_method
;
24 protected bool is_resolved
;
25 protected int gen_param_count
;
27 protected Hashtable gen_method_table
;
29 public BaseMethodRef (BaseTypeRef owner
, PEAPI
.CallConv call_conv
,
30 BaseTypeRef ret_type
, string name
, BaseTypeRef
[] param
, int gen_param_count
)
33 this.call_conv
= call_conv
;
34 this.ret_type
= ret_type
;
37 this.gen_param_count
= gen_param_count
;
38 if (gen_param_count
> 0)
39 CallConv
|= PEAPI
.CallConv
.Generic
;
43 public virtual PEAPI
.Method PeapiMethod
{
44 get { return peapi_method; }
47 public virtual PEAPI
.CallConv CallConv
{
48 get { return call_conv; }
49 set { call_conv = value; }
52 public virtual BaseTypeRef Owner
{
56 public abstract void Resolve (CodeGen code_gen
);
58 public GenericMethodRef
GetGenericMethodRef (GenericArguments gen_args
)
60 GenericMethodRef methref
= null;
62 if (gen_method_table
== null)
63 gen_method_table
= new Hashtable ();
65 methref
= (GenericMethodRef
) gen_method_table
[gen_args
.ToString ()];
67 if (methref
== null) {
68 methref
= new GenericMethodRef (this, GenericMethodSig
.GetInstance (gen_args
));
69 gen_method_table
[gen_args
.ToString ()] = methref
;