Browse Source

Regenerated the parser bindings with all fixes for v-tables and dtors.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/553/head
Dimitar Dobrev 10 years ago
parent
commit
beabb8224d
  1. 4
      src/Core/Parser/ASTConverter.cs
  2. 16
      src/CppParser/AST.cpp
  3. 3
      src/CppParser/AST.h
  4. 2240
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
  5. 105
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
  6. 21
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
  7. 2240
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  8. 105
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
  9. 21
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
  10. 2240
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
  11. 105
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs
  12. 21
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
  13. 2240
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
  14. 105
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
  15. 21
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs

4
src/Core/Parser/ASTConverter.cs

@ -957,8 +957,6 @@ namespace CppSharp @@ -957,8 +957,6 @@ namespace CppSharp
expression.Declaration = typeConverter.declConverter.Visit(statement.Decl);
expression.String = statement.String;
NativeObjects.Add(statement);
return expression;
}
@ -1314,8 +1312,6 @@ namespace CppSharp @@ -1314,8 +1312,6 @@ namespace CppSharp
_layout.VFTables.Add(_vftableInfo);
}
NativeObjects.Add(layout);
return _layout;
}

16
src/CppParser/AST.cpp

@ -178,6 +178,10 @@ Declaration::Declaration(const Declaration& rhs) @@ -178,6 +178,10 @@ Declaration::Declaration(const Declaration& rhs)
{
}
Declaration::~Declaration()
{
}
DEF_STRING(Declaration, Name)
DEF_STRING(Declaration, DebugText)
DEF_VECTOR(Declaration, PreprocessedEntity*, PreprocessedEntities)
@ -492,6 +496,12 @@ DEF_VECTOR(CXXConstructExpr, Expression*, Arguments) @@ -492,6 +496,12 @@ DEF_VECTOR(CXXConstructExpr, Expression*, Arguments)
Parameter::Parameter() : Declaration(DeclarationKind::Parameter),
IsIndirect(false), HasDefaultValue(false), DefaultArgument(0) {}
Parameter::~Parameter()
{
if (DefaultArgument)
delete DefaultArgument;
}
Function::Function()
: Declaration(DeclarationKind::Function)
, IsReturnIndirect(false)
@ -569,6 +579,12 @@ Class::Class() @@ -569,6 +579,12 @@ Class::Class()
{
}
Class::~Class()
{
if (Layout)
delete Layout;
}
DEF_VECTOR(Class, BaseClassSpecifier*, Bases)
DEF_VECTOR(Class, Field*, Fields)
DEF_VECTOR(Class, Method*, Methods)

3
src/CppParser/AST.h

@ -387,6 +387,7 @@ class CS_API Declaration @@ -387,6 +387,7 @@ class CS_API Declaration
public:
Declaration(DeclarationKind kind);
Declaration(const Declaration&);
~Declaration();
DeclarationKind Kind;
AccessSpecifier Access;
@ -522,6 +523,7 @@ class CS_API Parameter : public Declaration @@ -522,6 +523,7 @@ class CS_API Parameter : public Declaration
{
public:
Parameter();
~Parameter();
CppSharp::CppParser::AST::QualifiedType QualifiedType;
bool IsIndirect;
@ -709,6 +711,7 @@ class CS_API Class : public DeclarationContext @@ -709,6 +711,7 @@ class CS_API Class : public DeclarationContext
{
public:
Class();
~Class();
VECTOR(BaseClassSpecifier*, Bases)
VECTOR(Field*, Fields)

2240
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs

File diff suppressed because it is too large Load Diff

105
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs

@ -60,16 +60,16 @@ namespace CppSharp @@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(108)]
public bool NoStandardIncludes;
public byte NoStandardIncludes;
[FieldOffset(109)]
public bool NoBuiltinIncludes;
public byte NoBuiltinIncludes;
[FieldOffset(110)]
public bool MicrosoftMode;
public byte MicrosoftMode;
[FieldOffset(111)]
public bool Verbose;
public byte Verbose;
[FieldOffset(112)]
public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp @@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -268,17 +269,17 @@ namespace CppSharp @@ -268,17 +269,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(116);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserOptions(CppSharp.Parser.ParserOptions _0)
{
__Instance = Marshal.AllocHGlobal(116);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -288,21 +289,11 @@ namespace CppSharp @@ -288,21 +289,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -548,12 +539,12 @@ namespace CppSharp @@ -548,12 +539,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoStandardIncludes;
return ((Internal*) __Instance)->NoStandardIncludes != 0;
}
set
{
((Internal*) __Instance)->NoStandardIncludes = value;
((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
}
}
@ -561,12 +552,12 @@ namespace CppSharp @@ -561,12 +552,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoBuiltinIncludes;
return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
}
set
{
((Internal*) __Instance)->NoBuiltinIncludes = value;
((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
}
}
@ -574,12 +565,12 @@ namespace CppSharp @@ -574,12 +565,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->MicrosoftMode;
return ((Internal*) __Instance)->MicrosoftMode != 0;
}
set
{
((Internal*) __Instance)->MicrosoftMode = value;
((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
}
}
@ -587,12 +578,12 @@ namespace CppSharp @@ -587,12 +578,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->Verbose;
return ((Internal*) __Instance)->Verbose != 0;
}
set
{
((Internal*) __Instance)->Verbose = value;
((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
}
}
@ -662,8 +653,9 @@ namespace CppSharp @@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -698,17 +690,17 @@ namespace CppSharp @@ -698,17 +690,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(36);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{
__Instance = Marshal.AllocHGlobal(36);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -718,21 +710,11 @@ namespace CppSharp @@ -718,21 +710,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -863,8 +845,9 @@ namespace CppSharp @@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -899,17 +882,17 @@ namespace CppSharp @@ -899,17 +882,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserResult(CppSharp.Parser.ParserResult _0)
{
__Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -919,21 +902,11 @@ namespace CppSharp @@ -919,21 +902,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -1042,8 +1015,9 @@ namespace CppSharp @@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -1085,8 +1059,8 @@ namespace CppSharp @@ -1085,8 +1059,8 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -1096,19 +1070,10 @@ namespace CppSharp @@ -1096,19 +1070,10 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

21
src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp @@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -208,17 +209,17 @@ namespace CppSharp @@ -208,17 +209,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(164);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_1(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0)
{
__Instance = Marshal.AllocHGlobal(164);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -228,21 +229,11 @@ namespace CppSharp @@ -228,21 +229,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

2240
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs

File diff suppressed because it is too large Load Diff

105
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs

@ -60,16 +60,16 @@ namespace CppSharp @@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(132)]
public bool NoStandardIncludes;
public byte NoStandardIncludes;
[FieldOffset(133)]
public bool NoBuiltinIncludes;
public byte NoBuiltinIncludes;
[FieldOffset(134)]
public bool MicrosoftMode;
public byte MicrosoftMode;
[FieldOffset(135)]
public bool Verbose;
public byte Verbose;
[FieldOffset(136)]
public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp @@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -268,17 +269,17 @@ namespace CppSharp @@ -268,17 +269,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(140);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserOptions(CppSharp.Parser.ParserOptions _0)
{
__Instance = Marshal.AllocHGlobal(140);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -288,21 +289,11 @@ namespace CppSharp @@ -288,21 +289,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance, 0);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -548,12 +539,12 @@ namespace CppSharp @@ -548,12 +539,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoStandardIncludes;
return ((Internal*) __Instance)->NoStandardIncludes != 0;
}
set
{
((Internal*) __Instance)->NoStandardIncludes = value;
((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
}
}
@ -561,12 +552,12 @@ namespace CppSharp @@ -561,12 +552,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoBuiltinIncludes;
return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
}
set
{
((Internal*) __Instance)->NoBuiltinIncludes = value;
((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
}
}
@ -574,12 +565,12 @@ namespace CppSharp @@ -574,12 +565,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->MicrosoftMode;
return ((Internal*) __Instance)->MicrosoftMode != 0;
}
set
{
((Internal*) __Instance)->MicrosoftMode = value;
((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
}
}
@ -587,12 +578,12 @@ namespace CppSharp @@ -587,12 +578,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->Verbose;
return ((Internal*) __Instance)->Verbose != 0;
}
set
{
((Internal*) __Instance)->Verbose = value;
((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
}
}
@ -662,8 +653,9 @@ namespace CppSharp @@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -698,17 +690,17 @@ namespace CppSharp @@ -698,17 +690,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(60);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{
__Instance = Marshal.AllocHGlobal(60);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -718,21 +710,11 @@ namespace CppSharp @@ -718,21 +710,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance, 0);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -863,8 +845,9 @@ namespace CppSharp @@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -899,17 +882,17 @@ namespace CppSharp @@ -899,17 +882,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserResult(CppSharp.Parser.ParserResult _0)
{
__Instance = Marshal.AllocHGlobal(28);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -919,21 +902,11 @@ namespace CppSharp @@ -919,21 +902,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance, 0);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -1042,8 +1015,9 @@ namespace CppSharp @@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -1085,8 +1059,8 @@ namespace CppSharp @@ -1085,8 +1059,8 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -1096,19 +1070,10 @@ namespace CppSharp @@ -1096,19 +1070,10 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

21
src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp @@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -208,17 +209,17 @@ namespace CppSharp @@ -208,17 +209,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_1(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0)
{
__Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -228,21 +229,11 @@ namespace CppSharp @@ -228,21 +229,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance, 0);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

2240
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs

File diff suppressed because it is too large Load Diff

105
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs

@ -60,16 +60,16 @@ namespace CppSharp @@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(212)]
public bool NoStandardIncludes;
public byte NoStandardIncludes;
[FieldOffset(213)]
public bool NoBuiltinIncludes;
public byte NoBuiltinIncludes;
[FieldOffset(214)]
public bool MicrosoftMode;
public byte MicrosoftMode;
[FieldOffset(215)]
public bool Verbose;
public byte Verbose;
[FieldOffset(216)]
public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp @@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -268,17 +269,17 @@ namespace CppSharp @@ -268,17 +269,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(224);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserOptions(CppSharp.Parser.ParserOptions _0)
{
__Instance = Marshal.AllocHGlobal(224);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -288,21 +289,11 @@ namespace CppSharp @@ -288,21 +289,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -548,12 +539,12 @@ namespace CppSharp @@ -548,12 +539,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoStandardIncludes;
return ((Internal*) __Instance)->NoStandardIncludes != 0;
}
set
{
((Internal*) __Instance)->NoStandardIncludes = value;
((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
}
}
@ -561,12 +552,12 @@ namespace CppSharp @@ -561,12 +552,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoBuiltinIncludes;
return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
}
set
{
((Internal*) __Instance)->NoBuiltinIncludes = value;
((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
}
}
@ -574,12 +565,12 @@ namespace CppSharp @@ -574,12 +565,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->MicrosoftMode;
return ((Internal*) __Instance)->MicrosoftMode != 0;
}
set
{
((Internal*) __Instance)->MicrosoftMode = value;
((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
}
}
@ -587,12 +578,12 @@ namespace CppSharp @@ -587,12 +578,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->Verbose;
return ((Internal*) __Instance)->Verbose != 0;
}
set
{
((Internal*) __Instance)->Verbose = value;
((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
}
}
@ -662,8 +653,9 @@ namespace CppSharp @@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -698,17 +690,17 @@ namespace CppSharp @@ -698,17 +690,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(64);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{
__Instance = Marshal.AllocHGlobal(64);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -718,21 +710,11 @@ namespace CppSharp @@ -718,21 +710,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -863,8 +845,9 @@ namespace CppSharp @@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -899,17 +882,17 @@ namespace CppSharp @@ -899,17 +882,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserResult(CppSharp.Parser.ParserResult _0)
{
__Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -919,21 +902,11 @@ namespace CppSharp @@ -919,21 +902,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -1042,8 +1015,9 @@ namespace CppSharp @@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -1085,8 +1059,8 @@ namespace CppSharp @@ -1085,8 +1059,8 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -1096,19 +1070,10 @@ namespace CppSharp @@ -1096,19 +1070,10 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

21
src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp @@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -208,17 +209,17 @@ namespace CppSharp @@ -208,17 +209,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_1(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserTargetInfo(CppSharp.Parser.ParserTargetInfo _0)
{
__Instance = Marshal.AllocHGlobal(176);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_2(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -228,21 +229,11 @@ namespace CppSharp @@ -228,21 +229,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

2240
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs

File diff suppressed because it is too large Load Diff

105
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs

@ -60,16 +60,16 @@ namespace CppSharp @@ -60,16 +60,16 @@ namespace CppSharp
public CppSharp.Parser.AST.CppAbi Abi;
[FieldOffset(180)]
public bool NoStandardIncludes;
public byte NoStandardIncludes;
[FieldOffset(181)]
public bool NoBuiltinIncludes;
public byte NoBuiltinIncludes;
[FieldOffset(182)]
public bool MicrosoftMode;
public byte MicrosoftMode;
[FieldOffset(183)]
public bool Verbose;
public byte Verbose;
[FieldOffset(184)]
public CppSharp.Parser.LanguageVersion LanguageVersion;
@ -232,8 +232,9 @@ namespace CppSharp @@ -232,8 +232,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -268,17 +269,17 @@ namespace CppSharp @@ -268,17 +269,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(192);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserOptions(CppSharp.Parser.ParserOptions _0)
{
__Instance = Marshal.AllocHGlobal(192);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -288,21 +289,11 @@ namespace CppSharp @@ -288,21 +289,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserOptions __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -548,12 +539,12 @@ namespace CppSharp @@ -548,12 +539,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoStandardIncludes;
return ((Internal*) __Instance)->NoStandardIncludes != 0;
}
set
{
((Internal*) __Instance)->NoStandardIncludes = value;
((Internal*) __Instance)->NoStandardIncludes = (byte) (value ? 1 : 0);
}
}
@ -561,12 +552,12 @@ namespace CppSharp @@ -561,12 +552,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->NoBuiltinIncludes;
return ((Internal*) __Instance)->NoBuiltinIncludes != 0;
}
set
{
((Internal*) __Instance)->NoBuiltinIncludes = value;
((Internal*) __Instance)->NoBuiltinIncludes = (byte) (value ? 1 : 0);
}
}
@ -574,12 +565,12 @@ namespace CppSharp @@ -574,12 +565,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->MicrosoftMode;
return ((Internal*) __Instance)->MicrosoftMode != 0;
}
set
{
((Internal*) __Instance)->MicrosoftMode = value;
((Internal*) __Instance)->MicrosoftMode = (byte) (value ? 1 : 0);
}
}
@ -587,12 +578,12 @@ namespace CppSharp @@ -587,12 +578,12 @@ namespace CppSharp
{
get
{
return ((Internal*) __Instance)->Verbose;
return ((Internal*) __Instance)->Verbose != 0;
}
set
{
((Internal*) __Instance)->Verbose = value;
((Internal*) __Instance)->Verbose = (byte) (value ? 1 : 0);
}
}
@ -662,8 +653,9 @@ namespace CppSharp @@ -662,8 +653,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -698,17 +690,17 @@ namespace CppSharp @@ -698,17 +690,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(32);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserDiagnostic(CppSharp.Parser.ParserDiagnostic _0)
{
__Instance = Marshal.AllocHGlobal(32);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -718,21 +710,11 @@ namespace CppSharp @@ -718,21 +710,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserDiagnostic __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -863,8 +845,9 @@ namespace CppSharp @@ -863,8 +845,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -899,17 +882,17 @@ namespace CppSharp @@ -899,17 +882,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_0(__Instance);
NativeToManagedMap[__Instance] = this;
}
public ParserResult(CppSharp.Parser.ParserResult _0)
{
__Instance = Marshal.AllocHGlobal(56);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_1(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -919,21 +902,11 @@ namespace CppSharp @@ -919,21 +902,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserResult __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}
@ -1042,8 +1015,9 @@ namespace CppSharp @@ -1042,8 +1015,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -1085,8 +1059,8 @@ namespace CppSharp @@ -1085,8 +1059,8 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(0);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((ClangParser.Internal*) __Instance) = *((ClangParser.Internal*) _0.__Instance);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -1096,19 +1070,10 @@ namespace CppSharp @@ -1096,19 +1070,10 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ClangParser __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

21
src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs

@ -172,8 +172,9 @@ namespace CppSharp @@ -172,8 +172,9 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; }
public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
protected void*[] __OriginalVTables;
private bool __ownsNativeInstance;
protected bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{
@ -208,17 +209,17 @@ namespace CppSharp @@ -208,17 +209,17 @@ namespace CppSharp
{
__Instance = Marshal.AllocHGlobal(160);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
var arg0 = ReferenceEquals(_0, null) ? global::System.IntPtr.Zero : _0.__Instance;
Internal.cctor_0(__Instance, arg0);
NativeToManagedMap[__Instance] = this;
}
public ParserTargetInfo()
{
__Instance = Marshal.AllocHGlobal(160);
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
Internal.ctor_2(__Instance);
NativeToManagedMap[__Instance] = this;
}
public void Dispose()
@ -228,21 +229,11 @@ namespace CppSharp @@ -228,21 +229,11 @@ namespace CppSharp
protected virtual void Dispose(bool disposing)
{
DestroyNativeInstance(false);
}
public virtual void DestroyNativeInstance()
{
DestroyNativeInstance(true);
}
private void DestroyNativeInstance(bool force)
{
if (!__ownsNativeInstance && disposing)
throw new global::System.InvalidOperationException("Managed instances owned by native code cannot be disposed of.");
CppSharp.Parser.ParserTargetInfo __dummy;
NativeToManagedMap.TryRemove(__Instance, out __dummy);
if (__ownsNativeInstance || force)
Internal.dtor_0(__Instance);
if (__ownsNativeInstance)
Marshal.FreeHGlobal(__Instance);
}

Loading…
Cancel
Save