2 // Mono.ILASM.BaseClassRef
5 // Ankit Jain <jankit@novell.com>
7 // Copyright 2006 Novell, Inc (http://www.novell.com)
11 using System
.Collections
;
13 namespace Mono
.ILASM
{
15 public abstract class BaseClassRef
: BaseTypeRef
{
17 protected Hashtable p_genericinst_table
;
18 protected bool is_valuetype
;
20 protected BaseClassRef (string full_name
, bool is_valuetype
)
21 : this (full_name
, is_valuetype
, null, null)
25 protected BaseClassRef (string full_name
, bool is_valuetype
, ArrayList conv_list
, string sig_mod
)
26 : base (full_name
, conv_list
, sig_mod
)
28 this.is_valuetype
= is_valuetype
;
29 p_genericinst_table
= null;
32 public PEAPI
.Class PeapiClass
{
33 get { return type as PEAPI.Class; }
36 public virtual void MakeValueClass ()
41 public virtual GenericTypeInst
GetGenericTypeInst (GenericArguments gen_args
)
43 return new GenericTypeInst (this, gen_args
, is_valuetype
);
46 public virtual PEAPI
.Type
ResolveInstance (CodeGen code_gen
, GenericArguments gen_args
)
48 PEAPI
.GenericTypeInst gtri
= null;
49 string sig
= gen_args
.ToString ();
51 if (p_genericinst_table
== null)
52 p_genericinst_table
= new Hashtable ();
54 gtri
= p_genericinst_table
[sig
] as PEAPI
.GenericTypeInst
;
60 gtri
= new PEAPI
.GenericTypeInst (PeapiType
, gen_args
.Resolve (code_gen
));
61 p_genericinst_table
[sig
] = gtri
;