1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
//
// Mono.ILASM.BaseMethodRef
//
// Author(s):
// Ankit Jain <JAnkit@novell.com>
//
// Copyright 2006 Novell, Inc (http://www.novell.com)
//
using System;
using System.Collections;
namespace Mono.ILASM {
public abstract class BaseMethodRef {
protected BaseTypeRef owner;
protected PEAPI.CallConv call_conv;
protected BaseTypeRef ret_type;
protected string name;
protected BaseTypeRef[] param;
protected PEAPI.Method peapi_method;
protected bool is_resolved;
protected int gen_param_count;
protected Hashtable gen_method_table;
public BaseMethodRef (BaseTypeRef owner, PEAPI.CallConv call_conv,
BaseTypeRef ret_type, string name, BaseTypeRef[] param, int gen_param_count)
{
this.owner = owner;
this.call_conv = call_conv;
this.ret_type = ret_type;
this.name = name;
this.param = param;
this.gen_param_count = gen_param_count;
if (gen_param_count > 0)
CallConv |= PEAPI.CallConv.Generic;
is_resolved = false;
}
public virtual PEAPI.Method PeapiMethod {
get { return peapi_method; }
}
public virtual PEAPI.CallConv CallConv {
get { return call_conv; }
set { call_conv = value; }
}
public virtual BaseTypeRef Owner {
get { return owner; }
}
public abstract void Resolve (CodeGen code_gen);
public GenericMethodRef GetGenericMethodRef (GenericArguments gen_args)
{
GenericMethodRef methref = null;
if (gen_method_table == null)
gen_method_table = new Hashtable ();
else
methref = (GenericMethodRef) gen_method_table [gen_args.ToString ()];
if (methref == null) {
methref = new GenericMethodRef (this, GenericMethodSig.GetInstance (gen_args));
gen_method_table [gen_args.ToString ()] = methref;
}
return methref;
}
}
}
|