mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
// |
|
// Mono.VisualC.Interop.Interfaces.cs |
|
// |
|
// Author: |
|
// Alexander Corrado (alexander.corrado@gmail.com) |
|
// |
|
// Copyright (C) 2010 Alexander Corrado |
|
// |
|
|
|
using System; |
|
using Mono.VisualC.Interop.ABI; |
|
|
|
namespace Mono.VisualC.Interop { |
|
public interface ICppObject : IDisposable { |
|
IntPtr Native { get; } |
|
int NativeSize { get; } |
|
} |
|
|
|
// A marker interface to signify that the vtable needs to include all |
|
// methods inherited from T as well. |
|
public interface Base<T> where T : ICppClass { |
|
} |
|
|
|
public interface ICppClass { |
|
VTable ClassVTable { get; } |
|
int NativeSize { get; } |
|
} |
|
|
|
// This should go without saying, but the C++ class must have a constructor |
|
// if it is to be instantiatable. |
|
public interface ICppClassInstantiatable : ICppClass { |
|
CppInstancePtr Alloc (); |
|
void Destruct (CppInstancePtr instance); |
|
} |
|
|
|
// It is recommended that managed wrappers implement ICppObject, but |
|
// I'm not making it required so that any arbitrary object can be exposed to |
|
// C++ via CppInstancePtr.ForManagedObject. |
|
public interface ICppClassOverridable<T> : ICppClass /* where T : ICppObject */ { |
|
CppInstancePtr Alloc (T managed); |
|
void Destruct (CppInstancePtr instance); |
|
} |
|
} |