2 // Mono.ILASM.TypeManager.cs
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
11 using System
.Collections
;
13 namespace Mono
.ILASM
{
15 public class TypeManager
{
17 private Hashtable type_table
;
18 private CodeGen code_gen
;
20 public TypeManager (CodeGen code_gen
)
22 this.code_gen
= code_gen
;
23 type_table
= new Hashtable ();
26 public TypeDef
this[string full_name
] {
28 return (TypeDef
) type_table
[full_name
];
31 type_table
[full_name
] = value;
35 public PEAPI
.Type
GetPeapiType (string full_name
)
37 TypeDef type_def
= (TypeDef
) type_table
[full_name
];
42 if (!type_def
.IsDefined
)
43 type_def
.Define (code_gen
);
45 return type_def
.PeapiType
;
48 public void DefineAll ()
50 ArrayList type_list
= new ArrayList (type_table
.Values
);
52 foreach (TypeDef typedef
in type_list
) {
53 typedef
.Define (code_gen
);