Cosmos/source/Cosmos.IL2CPU/VTablesImplRefs.cs
Matthijs ter Woord 675ce71d10 Ongoing work.
2015-07-31 08:34:28 -04:00

29 lines
1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Cosmos.IL2CPU {
public static class VTablesImplRefs {
public static readonly Assembly RuntimeAssemblyDef;
public static readonly Type VTablesImplDef;
public static readonly MethodBase SetTypeInfoRef;
public static readonly MethodBase SetMethodInfoRef;
public static readonly MethodBase GetMethodAddressForTypeRef;
public static readonly MethodBase IsInstanceRef;
static VTablesImplRefs() {
VTablesImplDef = typeof(VTablesImpl);
foreach (FieldInfo xField in typeof(VTablesImplRefs).GetFields()) {
if (xField.Name.EndsWith("Ref")) {
MethodBase xTempMethod = VTablesImplDef.GetMethod(xField.Name.Substring(0, xField.Name.Length - "Ref".Length));
if (xTempMethod == null) {
throw new Exception("Method '" + xField.Name.Substring(0, xField.Name.Length - "Ref".Length) + "' not found on RuntimeEngine!");
}
xField.SetValue(null, xTempMethod);
}
}
}
}
}