Browse Source

Stubbed CppTypeInfo.Cast<TBase>(ICppObject subClass)

pull/1/head
Alex Corrado 15 years ago
parent
commit
cc5623da09
  1. 2
      src/Mono.VisualC.Interop/ABI/CppAbi.cs
  2. 2
      src/Mono.VisualC.Interop/ABI/Impl/ItaniumAbi.cs
  3. 2
      src/Mono.VisualC.Interop/ABI/Impl/MsvcAbi.cs
  4. 4
      src/Mono.VisualC.Interop/ABI/Impl/MsvcTypeInfo.cs
  5. 10
      src/Mono.VisualC.Interop/CppTypeInfo.cs

2
src/Mono.VisualC.Interop/ABI/CppAbi.cs

@ -136,7 +136,7 @@ namespace Mono.VisualC.Interop.ABI {
protected virtual CppTypeInfo MakeTypeInfo (IEnumerable<PInvokeSignature> methods) protected virtual CppTypeInfo MakeTypeInfo (IEnumerable<PInvokeSignature> methods)
{ {
return new CppTypeInfo (this, methods.Where (m => IsVirtual (m.OrigMethod)), layout_type); return new CppTypeInfo (this, methods.Where (m => IsVirtual (m.OrigMethod)), layout_type, wrapper_type);
} }
protected virtual IEnumerable<PropertyInfo> GetProperties () protected virtual IEnumerable<PropertyInfo> GetProperties ()

2
src/Mono.VisualC.Interop/ABI/Impl/ItaniumAbi.cs

@ -55,7 +55,7 @@ namespace Mono.VisualC.Interop.ABI {
protected override CppTypeInfo MakeTypeInfo (IEnumerable<PInvokeSignature> methods) protected override CppTypeInfo MakeTypeInfo (IEnumerable<PInvokeSignature> methods)
{ {
return new CppTypeInfo (this, GetVirtualMethodSlots (methods), layout_type); return new CppTypeInfo (this, GetVirtualMethodSlots (methods), layout_type, wrapper_type);
} }
private IEnumerable<PInvokeSignature> GetVirtualMethodSlots (IEnumerable<PInvokeSignature> methods) private IEnumerable<PInvokeSignature> GetVirtualMethodSlots (IEnumerable<PInvokeSignature> methods)

2
src/Mono.VisualC.Interop/ABI/Impl/MsvcAbi.cs

@ -49,7 +49,7 @@ namespace Mono.VisualC.Interop.ABI {
protected override CppTypeInfo MakeTypeInfo (IEnumerable<PInvokeSignature> methods) protected override CppTypeInfo MakeTypeInfo (IEnumerable<PInvokeSignature> methods)
{ {
return new MsvcTypeInfo (this, methods.Where (m => IsVirtual (m.OrigMethod)), layout_type); return new MsvcTypeInfo (this, methods.Where (m => IsVirtual (m.OrigMethod)), layout_type, wrapper_type);
} }
public override CallingConvention? GetCallingConvention (MethodInfo methodInfo) public override CallingConvention? GetCallingConvention (MethodInfo methodInfo)

4
src/Mono.VisualC.Interop/ABI/Impl/MsvcTypeInfo.cs

@ -33,8 +33,8 @@ using Mono.VisualC.Interop.Util;
namespace Mono.VisualC.Interop.ABI { namespace Mono.VisualC.Interop.ABI {
public class MsvcTypeInfo : CppTypeInfo { public class MsvcTypeInfo : CppTypeInfo {
public MsvcTypeInfo (MsvcAbi abi, IEnumerable<PInvokeSignature> virtualMethods, Type nativeLayout) public MsvcTypeInfo (MsvcAbi abi, IEnumerable<PInvokeSignature> virtualMethods, Type nativeLayout, Type wrapperType)
: base (abi, virtualMethods, nativeLayout) : base (abi, virtualMethods, nativeLayout, wrapperType)
{ {
} }

10
src/Mono.VisualC.Interop/CppTypeInfo.cs

@ -45,6 +45,7 @@ namespace Mono.VisualC.Interop {
public CppAbi Abi { get; private set; } public CppAbi Abi { get; private set; }
public Type NativeLayout { get; private set; } public Type NativeLayout { get; private set; }
public Type WrapperType { get; private set; }
public IList<PInvokeSignature> VirtualMethods { get; private set; } // read only version public IList<PInvokeSignature> VirtualMethods { get; private set; } // read only version
protected List<PInvokeSignature> virtual_methods; protected List<PInvokeSignature> virtual_methods;
@ -69,10 +70,11 @@ namespace Mono.VisualC.Interop {
private VTable lazy_vtable; private VTable lazy_vtable;
public CppTypeInfo (CppAbi abi, IEnumerable<PInvokeSignature> virtualMethods, Type nativeLayout) public CppTypeInfo (CppAbi abi, IEnumerable<PInvokeSignature> virtualMethods, Type nativeLayout, Type/*?*/ wrapperType)
{ {
Abi = abi; Abi = abi;
NativeLayout = nativeLayout; NativeLayout = nativeLayout;
WrapperType = wrapperType;
virtual_methods = new List<PInvokeSignature> (virtualMethods); virtual_methods = new List<PInvokeSignature> (virtualMethods);
VirtualMethods = new ReadOnlyCollection<PInvokeSignature> (virtual_methods); VirtualMethods = new ReadOnlyCollection<PInvokeSignature> (virtual_methods);
@ -130,6 +132,12 @@ namespace Mono.VisualC.Interop {
(addVTablePointer? baseType.FieldOffsetPadding : baseType.field_offset_padding_without_vtptr); (addVTablePointer? baseType.FieldOffsetPadding : baseType.field_offset_padding_without_vtptr);
} }
public virtual TBase Cast<TBase> (ICppObject instance)
where TBase : ICppObject
{
throw new NotImplementedException ();
}
public int CountBases (Func<CppTypeInfo, bool> predicate) public int CountBases (Func<CppTypeInfo, bool> predicate)
{ {
int count = 0; int count = 0;

Loading…
Cancel
Save