Browse Source

Deleted the non-working marshalling interface and the option for it.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/719/head
Dimitar Dobrev 10 years ago
parent
commit
458f7ff25b
  1. 29
      src/Generator/Generators/CSharp/CSharpSources.cs
  2. 2
      src/Generator/Options.cs

29
src/Generator/Generators/CSharp/CSharpSources.cs

@ -489,11 +489,6 @@ namespace CppSharp.Generators.CSharp
PopBlock(NewLineKind.BeforeNextBlock); PopBlock(NewLineKind.BeforeNextBlock);
} }
if (Options.GenerateClassMarshals)
{
GenerateClassMarshals(@class);
}
GenerateClassConstructors(@class); GenerateClassConstructors(@class);
GenerateClassMethods(@class.Methods); GenerateClassMethods(@class.Methods);
@ -511,25 +506,6 @@ namespace CppSharp.Generators.CSharp
Context.TypeMaps.TypeMaps.Add(@class.Name, typeMap); Context.TypeMaps.TypeMaps.Add(@class.Name, typeMap);
} }
private void GenerateClassMarshals(Class @class)
{
WriteLine("int CppSharp.Runtime.ICppMarshal.NativeDataSize");
WriteStartBraceIndent();
WriteLine("get {{ return {0}; }}", @class.Layout.DataSize);
WriteCloseBraceIndent();
NewLine();
WriteLine("void CppSharp.Runtime.ICppMarshal.MarshalManagedToNative(global::System.IntPtr instance)");
WriteStartBraceIndent();
WriteCloseBraceIndent();
NewLine();
WriteLine("void CppSharp.Runtime.ICppMarshal.MarshalNativeToManaged(global::System.IntPtr instance)");
WriteStartBraceIndent();
WriteCloseBraceIndent();
NewLine();
}
private void GenerateInterface(Class @class) private void GenerateInterface(Class @class)
{ {
if (!@class.IsGenerated || @class.IsIncomplete) if (!@class.IsGenerated || @class.IsIncomplete)
@ -744,11 +720,6 @@ namespace CppSharp.Generators.CSharp
{ {
if (@class.IsRefType) if (@class.IsRefType)
bases.Add("IDisposable"); bases.Add("IDisposable");
if (Options.GenerateClassMarshals)
{
bases.Add("CppSharp.Runtime.ICppMarshal");
}
} }
if (bases.Count > 0 && !@class.IsStatic) if (bases.Count > 0 && !@class.IsStatic)

2
src/Generator/Options.cs

@ -17,7 +17,6 @@ namespace CppSharp
Modules = new List<Module> { SystemModule }; Modules = new List<Module> { SystemModule };
GeneratorKind = GeneratorKind.CSharp; GeneratorKind = GeneratorKind.CSharp;
GenerateClassMarshals = false;
OutputInteropIncludes = true; OutputInteropIncludes = true;
CommentPrefix = "///"; CommentPrefix = "///";
@ -87,7 +86,6 @@ namespace CppSharp
public bool OutputInteropIncludes; public bool OutputInteropIncludes;
public bool GenerateFunctionTemplates; public bool GenerateFunctionTemplates;
public bool GenerateInternalImports; public bool GenerateInternalImports;
public bool GenerateClassMarshals;
public bool UseHeaderDirectories; public bool UseHeaderDirectories;
/// <summary> /// <summary>

Loading…
Cancel
Save