**** Merged from MCS ****
[mono-project.git] / mcs / ilasm / codegen / ITypeRef.cs
blobe226e8f27829f8eccf6462b9a54200fd1328aa4d
1 //
2 // Mono.ILASM.ITypeRef
3 //
4 // Interface that all Type references must implement
5 //
6 // Author(s):
7 // Jackson Harper (Jackson@LatitudeGeo.com)
8 //
9 // (C) 2003 Jackson Harper, All rights reserved
13 using System;
14 using System.Collections;
16 namespace Mono.ILASM {
18 public interface ITypeRef {
20 /// <summary>
21 /// The full name of the type, <namespace>.<name>
22 /// ie System.Collections.ArrayList
23 /// </summary>
24 string FullName { get; }
26 bool IsPinned { get; }
27 bool IsRef { get; }
28 bool IsArray { get; }
29 bool UseTypeSpec { get; }
31 /// <summary>
32 /// The PEAPI.Type of this typeref, this is not guaranteed
33 /// to be correct untill after this is resolved.
34 /// </summary>
35 PEAPI.Type PeapiType { get; }
37 /// <summary>
38 /// Convert this typeref into a zero based array
39 /// </summary>
40 void MakeArray ();
42 /// <summary>
43 /// Convert this typeref into a bound array. The ArrayList
44 /// should be in the format Entry (lower_bound, upper_bound) with
45 /// null being used for unset bounds.
46 /// </summary>
47 void MakeBoundArray (ArrayList bounds);
49 /// <summary>
50 /// Convert this typeref into a reference
51 /// </summary>
52 void MakeManagedPointer ();
54 /// <summary>
55 /// Convert this typeref into an unmanaged pointer
56 /// </summary>
57 void MakeUnmanagedPointer ();
59 /// <summary>
60 /// Convert this typeref into a CustomModifiedType
61 /// </summary>
62 void MakeCustomModified (CodeGen code_gen,
63 PEAPI.CustomModifier modifier, IClassRef klass);
65 /// <summary>
66 /// Make this typeref pinned.
67 /// </summary>
68 void MakePinned ();
70 void Resolve (CodeGen code_gen);
72 IMethodRef GetMethodRef (ITypeRef ret_type, PEAPI.CallConv call_conv,
73 string name, ITypeRef[] param);
75 IFieldRef GetFieldRef (ITypeRef ret_type, string name);
77 /// <summary>
78 /// Convert this typeref to a classref if not possible
79 /// throw an exception
80 /// </summary>
81 // IClassRef AsClassRef (CodeGen code_gen);