Browse Source

Removed the memory leak in the AST converter.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/540/head
Dimitar Dobrev 10 years ago
parent
commit
6432d910fa
  1. 98
      src/Core/Parser/ASTConverter.cs
  2. 1
      src/CppParser/AST.cpp
  3. 1
      src/CppParser/AST.h
  4. 865
      src/CppParser/Bindings/CLI/AST.cpp
  5. 115
      src/CppParser/Bindings/CLI/AST.h
  6. 52
      src/CppParser/Bindings/CLI/CppParser.cpp
  7. 12
      src/CppParser/Bindings/CLI/CppParser.h
  8. 13
      src/CppParser/Bindings/CLI/Target.cpp
  9. 3
      src/CppParser/Bindings/CLI/Target.h
  10. 450
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/AST.cs
  11. 24
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppParser.cs
  12. 6
      src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Target.cs
  13. 450
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  14. 24
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
  15. 6
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
  16. 450
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/AST.cs
  17. 24
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppParser.cs
  18. 6
      src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Target.cs
  19. 450
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/AST.cs
  20. 24
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/CppParser.cs
  21. 6
      src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Target.cs
  22. 19
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  23. 51
      src/Generator/Generators/CLI/CLISourcesTemplate.cs
  24. 12
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

98
src/Core/Parser/ASTConverter.cs

@ -36,77 +36,77 @@ namespace CppSharp
{ {
case TypeKind.Tag: case TypeKind.Tag:
{ {
var _type = TagType.__CreateInstance(type.__Instance); var _type = TagType.__CreateInstance(type.__Instance, true);
return VisitTag(_type); return VisitTag(_type);
} }
case TypeKind.Array: case TypeKind.Array:
{ {
var _type = ArrayType.__CreateInstance(type.__Instance); var _type = ArrayType.__CreateInstance(type.__Instance, true);
return VisitArray(_type); return VisitArray(_type);
} }
case TypeKind.Function: case TypeKind.Function:
{ {
var _type = FunctionType.__CreateInstance(type.__Instance); var _type = FunctionType.__CreateInstance(type.__Instance, true);
return VisitFunction(_type); return VisitFunction(_type);
} }
case TypeKind.Pointer: case TypeKind.Pointer:
{ {
var _type = PointerType.__CreateInstance(type.__Instance); var _type = PointerType.__CreateInstance(type.__Instance, true);
return VisitPointer(_type); return VisitPointer(_type);
} }
case TypeKind.MemberPointer: case TypeKind.MemberPointer:
{ {
var _type = MemberPointerType.__CreateInstance(type.__Instance); var _type = MemberPointerType.__CreateInstance(type.__Instance, true);
return VisitMemberPointer(_type); return VisitMemberPointer(_type);
} }
case TypeKind.Typedef: case TypeKind.Typedef:
{ {
var _type = TypedefType.__CreateInstance(type.__Instance); var _type = TypedefType.__CreateInstance(type.__Instance, true);
return VisitTypedef(_type); return VisitTypedef(_type);
} }
case TypeKind.Attributed: case TypeKind.Attributed:
{ {
var _type = AttributedType.__CreateInstance(type.__Instance); var _type = AttributedType.__CreateInstance(type.__Instance, true);
return VisitAttributed(_type); return VisitAttributed(_type);
} }
case TypeKind.Decayed: case TypeKind.Decayed:
{ {
var _type = DecayedType.__CreateInstance(type.__Instance); var _type = DecayedType.__CreateInstance(type.__Instance, true);
return VisitDecayed(_type); return VisitDecayed(_type);
} }
case TypeKind.TemplateSpecialization: case TypeKind.TemplateSpecialization:
{ {
var _type = TemplateSpecializationType.__CreateInstance(type.__Instance); var _type = TemplateSpecializationType.__CreateInstance(type.__Instance, true);
return VisitTemplateSpecialization(_type); return VisitTemplateSpecialization(_type);
} }
case TypeKind.TemplateParameter: case TypeKind.TemplateParameter:
{ {
var _type = TemplateParameterType.__CreateInstance(type.__Instance); var _type = TemplateParameterType.__CreateInstance(type.__Instance, true);
return VisitTemplateParameter(_type); return VisitTemplateParameter(_type);
} }
case TypeKind.TemplateParameterSubstitution: case TypeKind.TemplateParameterSubstitution:
{ {
var _type = TemplateParameterSubstitutionType.__CreateInstance(type.__Instance); var _type = TemplateParameterSubstitutionType.__CreateInstance(type.__Instance, true);
return VisitTemplateParameterSubstitution(_type); return VisitTemplateParameterSubstitution(_type);
} }
case TypeKind.InjectedClassName: case TypeKind.InjectedClassName:
{ {
var _type = InjectedClassNameType.__CreateInstance(type.__Instance); var _type = InjectedClassNameType.__CreateInstance(type.__Instance, true);
return VisitInjectedClassName(_type); return VisitInjectedClassName(_type);
} }
case TypeKind.DependentName: case TypeKind.DependentName:
{ {
var _type = DependentNameType.__CreateInstance(type.__Instance); var _type = DependentNameType.__CreateInstance(type.__Instance, true);
return VisitDependentName(_type); return VisitDependentName(_type);
} }
case TypeKind.Builtin: case TypeKind.Builtin:
{ {
var _type = BuiltinType.__CreateInstance(type.__Instance); var _type = BuiltinType.__CreateInstance(type.__Instance, true);
return VisitBuiltin(_type); return VisitBuiltin(_type);
} }
case TypeKind.PackExpansion: case TypeKind.PackExpansion:
{ {
var _type = PackExpansionType.__CreateInstance(type.__Instance); var _type = PackExpansionType.__CreateInstance(type.__Instance, true);
return VisitPackExpansion(_type); return VisitPackExpansion(_type);
} }
} }
@ -148,97 +148,97 @@ namespace CppSharp
{ {
case DeclarationKind.TranslationUnit: case DeclarationKind.TranslationUnit:
{ {
var _decl = TranslationUnit.__CreateInstance(decl.__Instance); var _decl = TranslationUnit.__CreateInstance(decl.__Instance, true);
return VisitTranslationUnit(_decl); return VisitTranslationUnit(_decl);
} }
case DeclarationKind.Namespace: case DeclarationKind.Namespace:
{ {
var _decl = Namespace.__CreateInstance(decl.__Instance); var _decl = Namespace.__CreateInstance(decl.__Instance, true);
return VisitNamespace(_decl); return VisitNamespace(_decl);
} }
case DeclarationKind.Typedef: case DeclarationKind.Typedef:
{ {
var _decl = TypedefDecl.__CreateInstance(decl.__Instance); var _decl = TypedefDecl.__CreateInstance(decl.__Instance, true);
return VisitTypedef(_decl); return VisitTypedef(_decl);
} }
case DeclarationKind.Parameter: case DeclarationKind.Parameter:
{ {
var _decl = Parameter.__CreateInstance(decl.__Instance); var _decl = Parameter.__CreateInstance(decl.__Instance, true);
return VisitParameter(_decl); return VisitParameter(_decl);
} }
case DeclarationKind.Function: case DeclarationKind.Function:
{ {
var _decl = Function.__CreateInstance(decl.__Instance); var _decl = Function.__CreateInstance(decl.__Instance, true);
return VisitFunction(_decl); return VisitFunction(_decl);
} }
case DeclarationKind.Method: case DeclarationKind.Method:
{ {
var _decl = Method.__CreateInstance(decl.__Instance); var _decl = Method.__CreateInstance(decl.__Instance, true);
return VisitMethod(_decl); return VisitMethod(_decl);
} }
case DeclarationKind.Enumeration: case DeclarationKind.Enumeration:
{ {
var _decl = Enumeration.__CreateInstance(decl.__Instance); var _decl = Enumeration.__CreateInstance(decl.__Instance, true);
return VisitEnumeration(_decl); return VisitEnumeration(_decl);
} }
case DeclarationKind.EnumerationItem: case DeclarationKind.EnumerationItem:
{ {
var _decl = Enumeration.Item.__CreateInstance(decl.__Instance); var _decl = Enumeration.Item.__CreateInstance(decl.__Instance, true);
return VisitEnumerationItem(_decl); return VisitEnumerationItem(_decl);
} }
case DeclarationKind.Variable: case DeclarationKind.Variable:
{ {
var _decl = Variable.__CreateInstance(decl.__Instance); var _decl = Variable.__CreateInstance(decl.__Instance, true);
return VisitVariable(_decl); return VisitVariable(_decl);
} }
case DeclarationKind.Friend: case DeclarationKind.Friend:
{ {
var _decl = Friend.__CreateInstance(decl.__Instance); var _decl = Friend.__CreateInstance(decl.__Instance, true);
return VisitFriend(_decl); return VisitFriend(_decl);
} }
case DeclarationKind.Field: case DeclarationKind.Field:
{ {
var _decl = Field.__CreateInstance(decl.__Instance); var _decl = Field.__CreateInstance(decl.__Instance, true);
return VisitField(_decl); return VisitField(_decl);
} }
case DeclarationKind.AccessSpecifier: case DeclarationKind.AccessSpecifier:
{ {
var _decl = AccessSpecifierDecl.__CreateInstance(decl.__Instance); var _decl = AccessSpecifierDecl.__CreateInstance(decl.__Instance, true);
return VisitAccessSpecifier(_decl); return VisitAccessSpecifier(_decl);
} }
case DeclarationKind.Class: case DeclarationKind.Class:
{ {
var _decl = Class.__CreateInstance(decl.__Instance); var _decl = Class.__CreateInstance(decl.__Instance, true);
return VisitClass(_decl); return VisitClass(_decl);
} }
case DeclarationKind.ClassTemplate: case DeclarationKind.ClassTemplate:
{ {
var _decl = ClassTemplate.__CreateInstance(decl.__Instance); var _decl = ClassTemplate.__CreateInstance(decl.__Instance, true);
return VisitClassTemplate(_decl); return VisitClassTemplate(_decl);
} }
case DeclarationKind.ClassTemplateSpecialization: case DeclarationKind.ClassTemplateSpecialization:
{ {
var _decl = ClassTemplateSpecialization.__CreateInstance(decl.__Instance); var _decl = ClassTemplateSpecialization.__CreateInstance(decl.__Instance, true);
return VisitClassTemplateSpecialization(_decl); return VisitClassTemplateSpecialization(_decl);
} }
case DeclarationKind.ClassTemplatePartialSpecialization: case DeclarationKind.ClassTemplatePartialSpecialization:
{ {
var _decl = ClassTemplatePartialSpecialization.__CreateInstance(decl.__Instance); var _decl = ClassTemplatePartialSpecialization.__CreateInstance(decl.__Instance, true);
return VisitClassTemplatePartialSpecialization(_decl); return VisitClassTemplatePartialSpecialization(_decl);
} }
case DeclarationKind.FunctionTemplate: case DeclarationKind.FunctionTemplate:
{ {
var _decl = FunctionTemplate.__CreateInstance(decl.__Instance); var _decl = FunctionTemplate.__CreateInstance(decl.__Instance, true);
return VisitFunctionTemplate(_decl); return VisitFunctionTemplate(_decl);
} }
case DeclarationKind.MacroDefinition: case DeclarationKind.MacroDefinition:
{ {
var _decl = MacroDefinition.__CreateInstance(decl.__Instance); var _decl = MacroDefinition.__CreateInstance(decl.__Instance, true);
return VisitMacroDefinition(_decl); return VisitMacroDefinition(_decl);
} }
case DeclarationKind.MacroExpansion: case DeclarationKind.MacroExpansion:
{ {
var _decl = MacroExpansion.__CreateInstance(decl.__Instance); var _decl = MacroExpansion.__CreateInstance(decl.__Instance, true);
return VisitMacroExpansion(_decl); return VisitMacroExpansion(_decl);
} }
} }
@ -345,6 +345,12 @@ namespace CppSharp
_ctx.TranslationUnits.Add(_unit); _ctx.TranslationUnits.Add(_unit);
} }
foreach (var nativeObject in typeConverter.NativeObjects)
nativeObject.Dispose();
foreach (var nativeObject in declConverter.NativeObjects)
nativeObject.Dispose();
return _ctx; return _ctx;
} }
} }
@ -353,6 +359,13 @@ namespace CppSharp
{ {
internal DeclConverter declConverter; internal DeclConverter declConverter;
public TypeConverter()
{
NativeObjects = new HashSet<IDisposable>();
}
public HashSet<IDisposable> NativeObjects { get; private set; }
public AST.QualifiedType VisitQualified(QualifiedType qualType) public AST.QualifiedType VisitQualified(QualifiedType qualType)
{ {
var _qualType = new AST.QualifiedType var _qualType = new AST.QualifiedType
@ -389,6 +402,7 @@ namespace CppSharp
void VisitType(Parser.AST.Type origType, CppSharp.AST.Type type) void VisitType(Parser.AST.Type origType, CppSharp.AST.Type type)
{ {
type.IsDependent = origType.IsDependent; type.IsDependent = origType.IsDependent;
NativeObjects.Add(origType);
} }
public override AST.Type VisitTag(TagType type) public override AST.Type VisitTag(TagType type)
@ -650,11 +664,14 @@ namespace CppSharp
public DeclConverter(TypeConverter type, CommentConverter comment) public DeclConverter(TypeConverter type, CommentConverter comment)
{ {
NativeObjects = new HashSet<IDisposable>();
typeConverter = type; typeConverter = type;
commentConverter = comment; commentConverter = comment;
Declarations = new Dictionary<IntPtr, AST.Declaration>(); Declarations = new Dictionary<IntPtr, AST.Declaration>();
} }
public HashSet<IDisposable> NativeObjects { get; private set; }
public override AST.Declaration Visit(Parser.AST.Declaration decl) public override AST.Declaration Visit(Parser.AST.Declaration decl)
{ {
if (decl == null) if (decl == null)
@ -785,6 +802,8 @@ namespace CppSharp
} }
_decl.OriginalPtr = originalPtr; _decl.OriginalPtr = originalPtr;
NativeObjects.Add(decl);
} }
void VisitDeclContext(DeclarationContext ctx, AST.DeclarationContext _ctx) void VisitDeclContext(DeclarationContext ctx, AST.DeclarationContext _ctx)
@ -936,6 +955,9 @@ namespace CppSharp
} }
expression.Declaration = typeConverter.declConverter.Visit(statement.Decl); expression.Declaration = typeConverter.declConverter.Visit(statement.Decl);
expression.String = statement.String; expression.String = statement.String;
NativeObjects.Add(statement);
return expression; return expression;
} }
@ -1291,6 +1313,8 @@ namespace CppSharp
_layout.VFTables.Add(_vftableInfo); _layout.VFTables.Add(_vftableInfo);
} }
NativeObjects.Add(layout);
return _layout; return _layout;
} }
@ -1323,6 +1347,8 @@ namespace CppSharp
Layout = VisitVTableLayout(vftableInfo.Layout) Layout = VisitVTableLayout(vftableInfo.Layout)
}; };
NativeObjects.Add(vftableInfo);
return _vftableInfo; return _vftableInfo;
} }
@ -1337,6 +1363,8 @@ namespace CppSharp
_layout.Components.Add(_component); _layout.Components.Add(_component);
} }
NativeObjects.Add(layout);
return _layout; return _layout;
} }
@ -1349,6 +1377,8 @@ namespace CppSharp
Declaration = Visit(component.Declaration) Declaration = Visit(component.Declaration)
}; };
NativeObjects.Add(component);
return _component; return _component;
} }

1
src/CppParser/AST.cpp

@ -129,6 +129,7 @@ VTableComponent::VTableComponent() : Offset(0), Declaration(0) {}
// VTableLayout // VTableLayout
VTableLayout::VTableLayout() {} VTableLayout::VTableLayout() {}
VTableLayout::VTableLayout(const VTableLayout& rhs) : Components(rhs.Components) {} VTableLayout::VTableLayout(const VTableLayout& rhs) : Components(rhs.Components) {}
VTableLayout::~VTableLayout() {}
DEF_VECTOR(VTableLayout, VTableComponent, Components) DEF_VECTOR(VTableLayout, VTableComponent, Components)

1
src/CppParser/AST.h

@ -310,6 +310,7 @@ struct CS_API VTableLayout
{ {
VTableLayout(); VTableLayout();
VTableLayout(const VTableLayout&); VTableLayout(const VTableLayout&);
~VTableLayout();
VECTOR(VTableComponent, Components) VECTOR(VTableComponent, Components)
}; };

865
src/CppParser/Bindings/CLI/AST.cpp

File diff suppressed because it is too large Load Diff

115
src/CppParser/Bindings/CLI/AST.h

@ -349,6 +349,7 @@ namespace CppSharp
Type(::CppSharp::CppParser::AST::Type* native); Type(::CppSharp::CppParser::AST::Type* native);
static Type^ __CreateInstance(::System::IntPtr native); static Type^ __CreateInstance(::System::IntPtr native);
static Type^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Type(CppSharp::Parser::AST::TypeKind kind); Type(CppSharp::Parser::AST::TypeKind kind);
Type(CppSharp::Parser::AST::Type^ _0); Type(CppSharp::Parser::AST::Type^ _0);
@ -367,7 +368,7 @@ namespace CppSharp
void set(bool); void set(bool);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -384,6 +385,7 @@ namespace CppSharp
TypeQualifiers(::CppSharp::CppParser::AST::TypeQualifiers* native); TypeQualifiers(::CppSharp::CppParser::AST::TypeQualifiers* native);
static TypeQualifiers^ __CreateInstance(::System::IntPtr native); static TypeQualifiers^ __CreateInstance(::System::IntPtr native);
static TypeQualifiers^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TypeQualifiers(CppSharp::Parser::AST::TypeQualifiers^ _0); TypeQualifiers(CppSharp::Parser::AST::TypeQualifiers^ _0);
TypeQualifiers(); TypeQualifiers();
@ -408,7 +410,7 @@ namespace CppSharp
void set(bool); void set(bool);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -425,6 +427,7 @@ namespace CppSharp
QualifiedType(::CppSharp::CppParser::AST::QualifiedType* native); QualifiedType(::CppSharp::CppParser::AST::QualifiedType* native);
static QualifiedType^ __CreateInstance(::System::IntPtr native); static QualifiedType^ __CreateInstance(::System::IntPtr native);
static QualifiedType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
QualifiedType(); QualifiedType();
QualifiedType(CppSharp::Parser::AST::QualifiedType^ _0); QualifiedType(CppSharp::Parser::AST::QualifiedType^ _0);
@ -443,7 +446,7 @@ namespace CppSharp
void set(CppSharp::Parser::AST::TypeQualifiers^); void set(CppSharp::Parser::AST::TypeQualifiers^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -453,6 +456,7 @@ namespace CppSharp
TagType(::CppSharp::CppParser::AST::TagType* native); TagType(::CppSharp::CppParser::AST::TagType* native);
static TagType^ __CreateInstance(::System::IntPtr native); static TagType^ __CreateInstance(::System::IntPtr native);
static TagType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TagType(); TagType();
TagType(CppSharp::Parser::AST::TagType^ _0); TagType(CppSharp::Parser::AST::TagType^ _0);
@ -480,6 +484,7 @@ namespace CppSharp
ArrayType(::CppSharp::CppParser::AST::ArrayType* native); ArrayType(::CppSharp::CppParser::AST::ArrayType* native);
static ArrayType^ __CreateInstance(::System::IntPtr native); static ArrayType^ __CreateInstance(::System::IntPtr native);
static ArrayType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ArrayType(); ArrayType();
ArrayType(CppSharp::Parser::AST::ArrayType^ _0); ArrayType(CppSharp::Parser::AST::ArrayType^ _0);
@ -511,6 +516,7 @@ namespace CppSharp
FunctionType(::CppSharp::CppParser::AST::FunctionType* native); FunctionType(::CppSharp::CppParser::AST::FunctionType* native);
static FunctionType^ __CreateInstance(::System::IntPtr native); static FunctionType^ __CreateInstance(::System::IntPtr native);
static FunctionType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
FunctionType(); FunctionType();
FunctionType(CppSharp::Parser::AST::FunctionType^ _0); FunctionType(CppSharp::Parser::AST::FunctionType^ _0);
@ -555,6 +561,7 @@ namespace CppSharp
PointerType(::CppSharp::CppParser::AST::PointerType* native); PointerType(::CppSharp::CppParser::AST::PointerType* native);
static PointerType^ __CreateInstance(::System::IntPtr native); static PointerType^ __CreateInstance(::System::IntPtr native);
static PointerType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
PointerType(); PointerType();
PointerType(CppSharp::Parser::AST::PointerType^ _0); PointerType(CppSharp::Parser::AST::PointerType^ _0);
@ -580,6 +587,7 @@ namespace CppSharp
MemberPointerType(::CppSharp::CppParser::AST::MemberPointerType* native); MemberPointerType(::CppSharp::CppParser::AST::MemberPointerType* native);
static MemberPointerType^ __CreateInstance(::System::IntPtr native); static MemberPointerType^ __CreateInstance(::System::IntPtr native);
static MemberPointerType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
MemberPointerType(); MemberPointerType();
MemberPointerType(CppSharp::Parser::AST::MemberPointerType^ _0); MemberPointerType(CppSharp::Parser::AST::MemberPointerType^ _0);
@ -599,6 +607,7 @@ namespace CppSharp
TypedefType(::CppSharp::CppParser::AST::TypedefType* native); TypedefType(::CppSharp::CppParser::AST::TypedefType* native);
static TypedefType^ __CreateInstance(::System::IntPtr native); static TypedefType^ __CreateInstance(::System::IntPtr native);
static TypedefType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TypedefType(); TypedefType();
TypedefType(CppSharp::Parser::AST::TypedefType^ _0); TypedefType(CppSharp::Parser::AST::TypedefType^ _0);
@ -618,6 +627,7 @@ namespace CppSharp
AttributedType(::CppSharp::CppParser::AST::AttributedType* native); AttributedType(::CppSharp::CppParser::AST::AttributedType* native);
static AttributedType^ __CreateInstance(::System::IntPtr native); static AttributedType^ __CreateInstance(::System::IntPtr native);
static AttributedType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
AttributedType(); AttributedType();
AttributedType(CppSharp::Parser::AST::AttributedType^ _0); AttributedType(CppSharp::Parser::AST::AttributedType^ _0);
@ -643,6 +653,7 @@ namespace CppSharp
DecayedType(::CppSharp::CppParser::AST::DecayedType* native); DecayedType(::CppSharp::CppParser::AST::DecayedType* native);
static DecayedType^ __CreateInstance(::System::IntPtr native); static DecayedType^ __CreateInstance(::System::IntPtr native);
static DecayedType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
DecayedType(); DecayedType();
DecayedType(CppSharp::Parser::AST::DecayedType^ _0); DecayedType(CppSharp::Parser::AST::DecayedType^ _0);
@ -693,6 +704,7 @@ namespace CppSharp
TemplateArgument(::CppSharp::CppParser::AST::TemplateArgument* native); TemplateArgument(::CppSharp::CppParser::AST::TemplateArgument* native);
static TemplateArgument^ __CreateInstance(::System::IntPtr native); static TemplateArgument^ __CreateInstance(::System::IntPtr native);
static TemplateArgument^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TemplateArgument(); TemplateArgument();
TemplateArgument(CppSharp::Parser::AST::TemplateArgument^ _0); TemplateArgument(CppSharp::Parser::AST::TemplateArgument^ _0);
@ -723,7 +735,7 @@ namespace CppSharp
void set(long); void set(long);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -733,6 +745,7 @@ namespace CppSharp
TemplateSpecializationType(::CppSharp::CppParser::AST::TemplateSpecializationType* native); TemplateSpecializationType(::CppSharp::CppParser::AST::TemplateSpecializationType* native);
static TemplateSpecializationType^ __CreateInstance(::System::IntPtr native); static TemplateSpecializationType^ __CreateInstance(::System::IntPtr native);
static TemplateSpecializationType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TemplateSpecializationType(); TemplateSpecializationType();
TemplateSpecializationType(CppSharp::Parser::AST::TemplateSpecializationType^ _0); TemplateSpecializationType(CppSharp::Parser::AST::TemplateSpecializationType^ _0);
@ -776,6 +789,7 @@ namespace CppSharp
TemplateParameter(::CppSharp::CppParser::AST::TemplateParameter* native); TemplateParameter(::CppSharp::CppParser::AST::TemplateParameter* native);
static TemplateParameter^ __CreateInstance(::System::IntPtr native); static TemplateParameter^ __CreateInstance(::System::IntPtr native);
static TemplateParameter^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TemplateParameter(); TemplateParameter();
TemplateParameter(CppSharp::Parser::AST::TemplateParameter^ _0); TemplateParameter(CppSharp::Parser::AST::TemplateParameter^ _0);
@ -798,7 +812,7 @@ namespace CppSharp
virtual bool Equals(::System::Object^ obj) override; virtual bool Equals(::System::Object^ obj) override;
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -808,6 +822,7 @@ namespace CppSharp
TemplateParameterType(::CppSharp::CppParser::AST::TemplateParameterType* native); TemplateParameterType(::CppSharp::CppParser::AST::TemplateParameterType* native);
static TemplateParameterType^ __CreateInstance(::System::IntPtr native); static TemplateParameterType^ __CreateInstance(::System::IntPtr native);
static TemplateParameterType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TemplateParameterType(); TemplateParameterType();
TemplateParameterType(CppSharp::Parser::AST::TemplateParameterType^ _0); TemplateParameterType(CppSharp::Parser::AST::TemplateParameterType^ _0);
@ -845,6 +860,7 @@ namespace CppSharp
TemplateParameterSubstitutionType(::CppSharp::CppParser::AST::TemplateParameterSubstitutionType* native); TemplateParameterSubstitutionType(::CppSharp::CppParser::AST::TemplateParameterSubstitutionType* native);
static TemplateParameterSubstitutionType^ __CreateInstance(::System::IntPtr native); static TemplateParameterSubstitutionType^ __CreateInstance(::System::IntPtr native);
static TemplateParameterSubstitutionType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TemplateParameterSubstitutionType(); TemplateParameterSubstitutionType();
TemplateParameterSubstitutionType(CppSharp::Parser::AST::TemplateParameterSubstitutionType^ _0); TemplateParameterSubstitutionType(CppSharp::Parser::AST::TemplateParameterSubstitutionType^ _0);
@ -864,6 +880,7 @@ namespace CppSharp
InjectedClassNameType(::CppSharp::CppParser::AST::InjectedClassNameType* native); InjectedClassNameType(::CppSharp::CppParser::AST::InjectedClassNameType* native);
static InjectedClassNameType^ __CreateInstance(::System::IntPtr native); static InjectedClassNameType^ __CreateInstance(::System::IntPtr native);
static InjectedClassNameType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
InjectedClassNameType(); InjectedClassNameType();
InjectedClassNameType(CppSharp::Parser::AST::InjectedClassNameType^ _0); InjectedClassNameType(CppSharp::Parser::AST::InjectedClassNameType^ _0);
@ -889,6 +906,7 @@ namespace CppSharp
DependentNameType(::CppSharp::CppParser::AST::DependentNameType* native); DependentNameType(::CppSharp::CppParser::AST::DependentNameType* native);
static DependentNameType^ __CreateInstance(::System::IntPtr native); static DependentNameType^ __CreateInstance(::System::IntPtr native);
static DependentNameType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
DependentNameType(); DependentNameType();
DependentNameType(CppSharp::Parser::AST::DependentNameType^ _0); DependentNameType(CppSharp::Parser::AST::DependentNameType^ _0);
@ -902,6 +920,7 @@ namespace CppSharp
PackExpansionType(::CppSharp::CppParser::AST::PackExpansionType* native); PackExpansionType(::CppSharp::CppParser::AST::PackExpansionType* native);
static PackExpansionType^ __CreateInstance(::System::IntPtr native); static PackExpansionType^ __CreateInstance(::System::IntPtr native);
static PackExpansionType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
PackExpansionType(); PackExpansionType();
PackExpansionType(CppSharp::Parser::AST::PackExpansionType^ _0); PackExpansionType(CppSharp::Parser::AST::PackExpansionType^ _0);
@ -915,6 +934,7 @@ namespace CppSharp
BuiltinType(::CppSharp::CppParser::AST::BuiltinType* native); BuiltinType(::CppSharp::CppParser::AST::BuiltinType* native);
static BuiltinType^ __CreateInstance(::System::IntPtr native); static BuiltinType^ __CreateInstance(::System::IntPtr native);
static BuiltinType^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
BuiltinType(); BuiltinType();
BuiltinType(CppSharp::Parser::AST::BuiltinType^ _0); BuiltinType(CppSharp::Parser::AST::BuiltinType^ _0);
@ -941,6 +961,7 @@ namespace CppSharp
VTableComponent(::CppSharp::CppParser::AST::VTableComponent* native); VTableComponent(::CppSharp::CppParser::AST::VTableComponent* native);
static VTableComponent^ __CreateInstance(::System::IntPtr native); static VTableComponent^ __CreateInstance(::System::IntPtr native);
static VTableComponent^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
VTableComponent(); VTableComponent();
VTableComponent(CppSharp::Parser::AST::VTableComponent^ _0); VTableComponent(CppSharp::Parser::AST::VTableComponent^ _0);
@ -965,7 +986,7 @@ namespace CppSharp
void set(CppSharp::Parser::AST::Declaration^); void set(CppSharp::Parser::AST::Declaration^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -982,6 +1003,7 @@ namespace CppSharp
VTableLayout(::CppSharp::CppParser::AST::VTableLayout* native); VTableLayout(::CppSharp::CppParser::AST::VTableLayout* native);
static VTableLayout^ __CreateInstance(::System::IntPtr native); static VTableLayout^ __CreateInstance(::System::IntPtr native);
static VTableLayout^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
VTableLayout(); VTableLayout();
VTableLayout(CppSharp::Parser::AST::VTableLayout^ _0); VTableLayout(CppSharp::Parser::AST::VTableLayout^ _0);
@ -999,7 +1021,7 @@ namespace CppSharp
void clearComponents(); void clearComponents();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -1016,6 +1038,7 @@ namespace CppSharp
VFTableInfo(::CppSharp::CppParser::AST::VFTableInfo* native); VFTableInfo(::CppSharp::CppParser::AST::VFTableInfo* native);
static VFTableInfo^ __CreateInstance(::System::IntPtr native); static VFTableInfo^ __CreateInstance(::System::IntPtr native);
static VFTableInfo^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
VFTableInfo(); VFTableInfo();
VFTableInfo(CppSharp::Parser::AST::VFTableInfo^ _0); VFTableInfo(CppSharp::Parser::AST::VFTableInfo^ _0);
@ -1046,7 +1069,7 @@ namespace CppSharp
void set(CppSharp::Parser::AST::VTableLayout^); void set(CppSharp::Parser::AST::VTableLayout^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -1063,6 +1086,7 @@ namespace CppSharp
ClassLayout(::CppSharp::CppParser::AST::ClassLayout* native); ClassLayout(::CppSharp::CppParser::AST::ClassLayout* native);
static ClassLayout^ __CreateInstance(::System::IntPtr native); static ClassLayout^ __CreateInstance(::System::IntPtr native);
static ClassLayout^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ClassLayout(); ClassLayout();
ClassLayout(CppSharp::Parser::AST::ClassLayout^ _0); ClassLayout(CppSharp::Parser::AST::ClassLayout^ _0);
@ -1122,7 +1146,7 @@ namespace CppSharp
void clearVFTables(); void clearVFTables();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -1139,6 +1163,7 @@ namespace CppSharp
Declaration(::CppSharp::CppParser::AST::Declaration* native); Declaration(::CppSharp::CppParser::AST::Declaration* native);
static Declaration^ __CreateInstance(::System::IntPtr native); static Declaration^ __CreateInstance(::System::IntPtr native);
static Declaration^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Declaration(CppSharp::Parser::AST::DeclarationKind kind); Declaration(CppSharp::Parser::AST::DeclarationKind kind);
Declaration(CppSharp::Parser::AST::Declaration^ _0); Declaration(CppSharp::Parser::AST::Declaration^ _0);
@ -1240,7 +1265,7 @@ namespace CppSharp
void clearPreprocessedEntities(); void clearPreprocessedEntities();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -1250,6 +1275,7 @@ namespace CppSharp
DeclarationContext(::CppSharp::CppParser::AST::DeclarationContext* native); DeclarationContext(::CppSharp::CppParser::AST::DeclarationContext* native);
static DeclarationContext^ __CreateInstance(::System::IntPtr native); static DeclarationContext^ __CreateInstance(::System::IntPtr native);
static DeclarationContext^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
DeclarationContext(CppSharp::Parser::AST::DeclarationKind kind); DeclarationContext(CppSharp::Parser::AST::DeclarationKind kind);
DeclarationContext(CppSharp::Parser::AST::DeclarationContext^ _0); DeclarationContext(CppSharp::Parser::AST::DeclarationContext^ _0);
@ -1357,6 +1383,7 @@ namespace CppSharp
TypedefDecl(::CppSharp::CppParser::AST::TypedefDecl* native); TypedefDecl(::CppSharp::CppParser::AST::TypedefDecl* native);
static TypedefDecl^ __CreateInstance(::System::IntPtr native); static TypedefDecl^ __CreateInstance(::System::IntPtr native);
static TypedefDecl^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TypedefDecl(); TypedefDecl();
TypedefDecl(CppSharp::Parser::AST::TypedefDecl^ _0); TypedefDecl(CppSharp::Parser::AST::TypedefDecl^ _0);
@ -1376,6 +1403,7 @@ namespace CppSharp
Friend(::CppSharp::CppParser::AST::Friend* native); Friend(::CppSharp::CppParser::AST::Friend* native);
static Friend^ __CreateInstance(::System::IntPtr native); static Friend^ __CreateInstance(::System::IntPtr native);
static Friend^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Friend(); Friend();
Friend(CppSharp::Parser::AST::Friend^ _0); Friend(CppSharp::Parser::AST::Friend^ _0);
@ -1402,6 +1430,7 @@ namespace CppSharp
Statement(::CppSharp::CppParser::AST::Statement* native); Statement(::CppSharp::CppParser::AST::Statement* native);
static Statement^ __CreateInstance(::System::IntPtr native); static Statement^ __CreateInstance(::System::IntPtr native);
static Statement^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Statement(CppSharp::Parser::AST::Statement^ _0); Statement(CppSharp::Parser::AST::Statement^ _0);
~Statement(); ~Statement();
@ -1424,7 +1453,7 @@ namespace CppSharp
void set(CppSharp::Parser::AST::Declaration^); void set(CppSharp::Parser::AST::Declaration^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -1434,6 +1463,7 @@ namespace CppSharp
Expression(::CppSharp::CppParser::AST::Expression* native); Expression(::CppSharp::CppParser::AST::Expression* native);
static Expression^ __CreateInstance(::System::IntPtr native); static Expression^ __CreateInstance(::System::IntPtr native);
static Expression^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Expression(CppSharp::Parser::AST::Expression^ _0); Expression(CppSharp::Parser::AST::Expression^ _0);
~Expression(); ~Expression();
@ -1445,6 +1475,7 @@ namespace CppSharp
BinaryOperator(::CppSharp::CppParser::AST::BinaryOperator* native); BinaryOperator(::CppSharp::CppParser::AST::BinaryOperator* native);
static BinaryOperator^ __CreateInstance(::System::IntPtr native); static BinaryOperator^ __CreateInstance(::System::IntPtr native);
static BinaryOperator^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
BinaryOperator(CppSharp::Parser::AST::BinaryOperator^ _0); BinaryOperator(CppSharp::Parser::AST::BinaryOperator^ _0);
~BinaryOperator(); ~BinaryOperator();
@ -1474,6 +1505,7 @@ namespace CppSharp
CXXConstructExpr(::CppSharp::CppParser::AST::CXXConstructExpr* native); CXXConstructExpr(::CppSharp::CppParser::AST::CXXConstructExpr* native);
static CXXConstructExpr^ __CreateInstance(::System::IntPtr native); static CXXConstructExpr^ __CreateInstance(::System::IntPtr native);
static CXXConstructExpr^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
CXXConstructExpr(CppSharp::Parser::AST::CXXConstructExpr^ _0); CXXConstructExpr(CppSharp::Parser::AST::CXXConstructExpr^ _0);
~CXXConstructExpr(); ~CXXConstructExpr();
@ -1496,6 +1528,7 @@ namespace CppSharp
Parameter(::CppSharp::CppParser::AST::Parameter* native); Parameter(::CppSharp::CppParser::AST::Parameter* native);
static Parameter^ __CreateInstance(::System::IntPtr native); static Parameter^ __CreateInstance(::System::IntPtr native);
static Parameter^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Parameter(); Parameter();
Parameter(CppSharp::Parser::AST::Parameter^ _0); Parameter(CppSharp::Parser::AST::Parameter^ _0);
@ -1539,6 +1572,7 @@ namespace CppSharp
Function(::CppSharp::CppParser::AST::Function* native); Function(::CppSharp::CppParser::AST::Function* native);
static Function^ __CreateInstance(::System::IntPtr native); static Function^ __CreateInstance(::System::IntPtr native);
static Function^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Function(); Function();
Function(CppSharp::Parser::AST::Function^ _0); Function(CppSharp::Parser::AST::Function^ _0);
@ -1635,6 +1669,7 @@ namespace CppSharp
Method(::CppSharp::CppParser::AST::Method* native); Method(::CppSharp::CppParser::AST::Method* native);
static Method^ __CreateInstance(::System::IntPtr native); static Method^ __CreateInstance(::System::IntPtr native);
static Method^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Method(); Method();
Method(CppSharp::Parser::AST::Method^ _0); Method(CppSharp::Parser::AST::Method^ _0);
@ -1732,6 +1767,7 @@ namespace CppSharp
Item(::CppSharp::CppParser::AST::Enumeration::Item* native); Item(::CppSharp::CppParser::AST::Enumeration::Item* native);
static Item^ __CreateInstance(::System::IntPtr native); static Item^ __CreateInstance(::System::IntPtr native);
static Item^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Item(); Item();
Item(CppSharp::Parser::AST::Enumeration::Item^ _0); Item(CppSharp::Parser::AST::Enumeration::Item^ _0);
@ -1753,6 +1789,7 @@ namespace CppSharp
Enumeration(::CppSharp::CppParser::AST::Enumeration* native); Enumeration(::CppSharp::CppParser::AST::Enumeration* native);
static Enumeration^ __CreateInstance(::System::IntPtr native); static Enumeration^ __CreateInstance(::System::IntPtr native);
static Enumeration^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Enumeration(); Enumeration();
Enumeration(CppSharp::Parser::AST::Enumeration^ _0); Enumeration(CppSharp::Parser::AST::Enumeration^ _0);
@ -1795,6 +1832,7 @@ namespace CppSharp
Variable(::CppSharp::CppParser::AST::Variable* native); Variable(::CppSharp::CppParser::AST::Variable* native);
static Variable^ __CreateInstance(::System::IntPtr native); static Variable^ __CreateInstance(::System::IntPtr native);
static Variable^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Variable(); Variable();
Variable(CppSharp::Parser::AST::Variable^ _0); Variable(CppSharp::Parser::AST::Variable^ _0);
@ -1827,6 +1865,7 @@ namespace CppSharp
BaseClassSpecifier(::CppSharp::CppParser::AST::BaseClassSpecifier* native); BaseClassSpecifier(::CppSharp::CppParser::AST::BaseClassSpecifier* native);
static BaseClassSpecifier^ __CreateInstance(::System::IntPtr native); static BaseClassSpecifier^ __CreateInstance(::System::IntPtr native);
static BaseClassSpecifier^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
BaseClassSpecifier(); BaseClassSpecifier();
BaseClassSpecifier(CppSharp::Parser::AST::BaseClassSpecifier^ _0); BaseClassSpecifier(CppSharp::Parser::AST::BaseClassSpecifier^ _0);
@ -1857,7 +1896,7 @@ namespace CppSharp
void set(int); void set(int);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -1867,6 +1906,7 @@ namespace CppSharp
Field(::CppSharp::CppParser::AST::Field* native); Field(::CppSharp::CppParser::AST::Field* native);
static Field^ __CreateInstance(::System::IntPtr native); static Field^ __CreateInstance(::System::IntPtr native);
static Field^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Field(); Field();
Field(CppSharp::Parser::AST::Field^ _0); Field(CppSharp::Parser::AST::Field^ _0);
@ -1910,6 +1950,7 @@ namespace CppSharp
AccessSpecifierDecl(::CppSharp::CppParser::AST::AccessSpecifierDecl* native); AccessSpecifierDecl(::CppSharp::CppParser::AST::AccessSpecifierDecl* native);
static AccessSpecifierDecl^ __CreateInstance(::System::IntPtr native); static AccessSpecifierDecl^ __CreateInstance(::System::IntPtr native);
static AccessSpecifierDecl^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
AccessSpecifierDecl(); AccessSpecifierDecl();
AccessSpecifierDecl(CppSharp::Parser::AST::AccessSpecifierDecl^ _0); AccessSpecifierDecl(CppSharp::Parser::AST::AccessSpecifierDecl^ _0);
@ -1923,6 +1964,7 @@ namespace CppSharp
Class(::CppSharp::CppParser::AST::Class* native); Class(::CppSharp::CppParser::AST::Class* native);
static Class^ __CreateInstance(::System::IntPtr native); static Class^ __CreateInstance(::System::IntPtr native);
static Class^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Class(); Class();
Class(CppSharp::Parser::AST::Class^ _0); Class(CppSharp::Parser::AST::Class^ _0);
@ -2040,6 +2082,7 @@ namespace CppSharp
Template(::CppSharp::CppParser::AST::Template* native); Template(::CppSharp::CppParser::AST::Template* native);
static Template^ __CreateInstance(::System::IntPtr native); static Template^ __CreateInstance(::System::IntPtr native);
static Template^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Template(CppSharp::Parser::AST::DeclarationKind kind); Template(CppSharp::Parser::AST::DeclarationKind kind);
Template(); Template();
@ -2072,6 +2115,7 @@ namespace CppSharp
ClassTemplate(::CppSharp::CppParser::AST::ClassTemplate* native); ClassTemplate(::CppSharp::CppParser::AST::ClassTemplate* native);
static ClassTemplate^ __CreateInstance(::System::IntPtr native); static ClassTemplate^ __CreateInstance(::System::IntPtr native);
static ClassTemplate^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ClassTemplate(); ClassTemplate();
ClassTemplate(CppSharp::Parser::AST::ClassTemplate^ _0); ClassTemplate(CppSharp::Parser::AST::ClassTemplate^ _0);
@ -2096,6 +2140,7 @@ namespace CppSharp
ClassTemplateSpecialization(::CppSharp::CppParser::AST::ClassTemplateSpecialization* native); ClassTemplateSpecialization(::CppSharp::CppParser::AST::ClassTemplateSpecialization* native);
static ClassTemplateSpecialization^ __CreateInstance(::System::IntPtr native); static ClassTemplateSpecialization^ __CreateInstance(::System::IntPtr native);
static ClassTemplateSpecialization^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ClassTemplateSpecialization(); ClassTemplateSpecialization();
ClassTemplateSpecialization(CppSharp::Parser::AST::ClassTemplateSpecialization^ _0); ClassTemplateSpecialization(CppSharp::Parser::AST::ClassTemplateSpecialization^ _0);
@ -2132,6 +2177,7 @@ namespace CppSharp
ClassTemplatePartialSpecialization(::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization* native); ClassTemplatePartialSpecialization(::CppSharp::CppParser::AST::ClassTemplatePartialSpecialization* native);
static ClassTemplatePartialSpecialization^ __CreateInstance(::System::IntPtr native); static ClassTemplatePartialSpecialization^ __CreateInstance(::System::IntPtr native);
static ClassTemplatePartialSpecialization^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ClassTemplatePartialSpecialization(); ClassTemplatePartialSpecialization();
ClassTemplatePartialSpecialization(CppSharp::Parser::AST::ClassTemplatePartialSpecialization^ _0); ClassTemplatePartialSpecialization(CppSharp::Parser::AST::ClassTemplatePartialSpecialization^ _0);
@ -2145,6 +2191,7 @@ namespace CppSharp
FunctionTemplate(::CppSharp::CppParser::AST::FunctionTemplate* native); FunctionTemplate(::CppSharp::CppParser::AST::FunctionTemplate* native);
static FunctionTemplate^ __CreateInstance(::System::IntPtr native); static FunctionTemplate^ __CreateInstance(::System::IntPtr native);
static FunctionTemplate^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
FunctionTemplate(); FunctionTemplate();
FunctionTemplate(CppSharp::Parser::AST::FunctionTemplate^ _0); FunctionTemplate(CppSharp::Parser::AST::FunctionTemplate^ _0);
@ -2176,6 +2223,7 @@ namespace CppSharp
FunctionTemplateSpecialization(::CppSharp::CppParser::AST::FunctionTemplateSpecialization* native); FunctionTemplateSpecialization(::CppSharp::CppParser::AST::FunctionTemplateSpecialization* native);
static FunctionTemplateSpecialization^ __CreateInstance(::System::IntPtr native); static FunctionTemplateSpecialization^ __CreateInstance(::System::IntPtr native);
static FunctionTemplateSpecialization^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
FunctionTemplateSpecialization(); FunctionTemplateSpecialization();
FunctionTemplateSpecialization(CppSharp::Parser::AST::FunctionTemplateSpecialization^ _0); FunctionTemplateSpecialization(CppSharp::Parser::AST::FunctionTemplateSpecialization^ _0);
@ -2211,7 +2259,7 @@ namespace CppSharp
void clearArguments(); void clearArguments();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -2221,6 +2269,7 @@ namespace CppSharp
Namespace(::CppSharp::CppParser::AST::Namespace* native); Namespace(::CppSharp::CppParser::AST::Namespace* native);
static Namespace^ __CreateInstance(::System::IntPtr native); static Namespace^ __CreateInstance(::System::IntPtr native);
static Namespace^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Namespace(); Namespace();
Namespace(CppSharp::Parser::AST::Namespace^ _0); Namespace(CppSharp::Parser::AST::Namespace^ _0);
@ -2240,6 +2289,7 @@ namespace CppSharp
PreprocessedEntity(::CppSharp::CppParser::AST::PreprocessedEntity* native); PreprocessedEntity(::CppSharp::CppParser::AST::PreprocessedEntity* native);
static PreprocessedEntity^ __CreateInstance(::System::IntPtr native); static PreprocessedEntity^ __CreateInstance(::System::IntPtr native);
static PreprocessedEntity^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
PreprocessedEntity(); PreprocessedEntity();
PreprocessedEntity(CppSharp::Parser::AST::PreprocessedEntity^ _0); PreprocessedEntity(CppSharp::Parser::AST::PreprocessedEntity^ _0);
@ -2259,6 +2309,7 @@ namespace CppSharp
MacroDefinition(::CppSharp::CppParser::AST::MacroDefinition* native); MacroDefinition(::CppSharp::CppParser::AST::MacroDefinition* native);
static MacroDefinition^ __CreateInstance(::System::IntPtr native); static MacroDefinition^ __CreateInstance(::System::IntPtr native);
static MacroDefinition^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
MacroDefinition(); MacroDefinition();
MacroDefinition(CppSharp::Parser::AST::MacroDefinition^ _0); MacroDefinition(CppSharp::Parser::AST::MacroDefinition^ _0);
@ -2278,6 +2329,7 @@ namespace CppSharp
MacroExpansion(::CppSharp::CppParser::AST::MacroExpansion* native); MacroExpansion(::CppSharp::CppParser::AST::MacroExpansion* native);
static MacroExpansion^ __CreateInstance(::System::IntPtr native); static MacroExpansion^ __CreateInstance(::System::IntPtr native);
static MacroExpansion^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
MacroExpansion(); MacroExpansion();
MacroExpansion(CppSharp::Parser::AST::MacroExpansion^ _0); MacroExpansion(CppSharp::Parser::AST::MacroExpansion^ _0);
@ -2303,6 +2355,7 @@ namespace CppSharp
TranslationUnit(::CppSharp::CppParser::AST::TranslationUnit* native); TranslationUnit(::CppSharp::CppParser::AST::TranslationUnit* native);
static TranslationUnit^ __CreateInstance(::System::IntPtr native); static TranslationUnit^ __CreateInstance(::System::IntPtr native);
static TranslationUnit^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TranslationUnit(); TranslationUnit();
TranslationUnit(CppSharp::Parser::AST::TranslationUnit^ _0); TranslationUnit(CppSharp::Parser::AST::TranslationUnit^ _0);
@ -2346,6 +2399,7 @@ namespace CppSharp
NativeLibrary(::CppSharp::CppParser::AST::NativeLibrary* native); NativeLibrary(::CppSharp::CppParser::AST::NativeLibrary* native);
static NativeLibrary^ __CreateInstance(::System::IntPtr native); static NativeLibrary^ __CreateInstance(::System::IntPtr native);
static NativeLibrary^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
NativeLibrary(); NativeLibrary();
NativeLibrary(CppSharp::Parser::AST::NativeLibrary^ _0); NativeLibrary(CppSharp::Parser::AST::NativeLibrary^ _0);
@ -2386,7 +2440,7 @@ namespace CppSharp
void clearDependencies(); void clearDependencies();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -2403,6 +2457,7 @@ namespace CppSharp
ASTContext(::CppSharp::CppParser::AST::ASTContext* native); ASTContext(::CppSharp::CppParser::AST::ASTContext* native);
static ASTContext^ __CreateInstance(::System::IntPtr native); static ASTContext^ __CreateInstance(::System::IntPtr native);
static ASTContext^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ASTContext(); ASTContext();
ASTContext(CppSharp::Parser::AST::ASTContext^ _0); ASTContext(CppSharp::Parser::AST::ASTContext^ _0);
@ -2420,7 +2475,7 @@ namespace CppSharp
void clearTranslationUnits(); void clearTranslationUnits();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -2437,6 +2492,7 @@ namespace CppSharp
Comment(::CppSharp::CppParser::AST::Comment* native); Comment(::CppSharp::CppParser::AST::Comment* native);
static Comment^ __CreateInstance(::System::IntPtr native); static Comment^ __CreateInstance(::System::IntPtr native);
static Comment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Comment(CppSharp::Parser::AST::CommentKind kind); Comment(CppSharp::Parser::AST::CommentKind kind);
Comment(CppSharp::Parser::AST::Comment^ _0); Comment(CppSharp::Parser::AST::Comment^ _0);
@ -2449,7 +2505,7 @@ namespace CppSharp
void set(CppSharp::Parser::AST::CommentKind); void set(CppSharp::Parser::AST::CommentKind);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -2459,6 +2515,7 @@ namespace CppSharp
BlockContentComment(::CppSharp::CppParser::AST::BlockContentComment* native); BlockContentComment(::CppSharp::CppParser::AST::BlockContentComment* native);
static BlockContentComment^ __CreateInstance(::System::IntPtr native); static BlockContentComment^ __CreateInstance(::System::IntPtr native);
static BlockContentComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
BlockContentComment(); BlockContentComment();
BlockContentComment(CppSharp::Parser::AST::CommentKind Kind); BlockContentComment(CppSharp::Parser::AST::CommentKind Kind);
@ -2474,6 +2531,7 @@ namespace CppSharp
FullComment(::CppSharp::CppParser::AST::FullComment* native); FullComment(::CppSharp::CppParser::AST::FullComment* native);
static FullComment^ __CreateInstance(::System::IntPtr native); static FullComment^ __CreateInstance(::System::IntPtr native);
static FullComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
FullComment(); FullComment();
FullComment(CppSharp::Parser::AST::FullComment^ _0); FullComment(CppSharp::Parser::AST::FullComment^ _0);
@ -2509,6 +2567,7 @@ namespace CppSharp
Argument(::CppSharp::CppParser::AST::BlockCommandComment::Argument* native); Argument(::CppSharp::CppParser::AST::BlockCommandComment::Argument* native);
static Argument^ __CreateInstance(::System::IntPtr native); static Argument^ __CreateInstance(::System::IntPtr native);
static Argument^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Argument(); Argument();
Argument(CppSharp::Parser::AST::BlockCommandComment::Argument^ _0); Argument(CppSharp::Parser::AST::BlockCommandComment::Argument^ _0);
@ -2521,12 +2580,13 @@ namespace CppSharp
void set(System::String^); void set(System::String^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
BlockCommandComment(::CppSharp::CppParser::AST::BlockCommandComment* native); BlockCommandComment(::CppSharp::CppParser::AST::BlockCommandComment* native);
static BlockCommandComment^ __CreateInstance(::System::IntPtr native); static BlockCommandComment^ __CreateInstance(::System::IntPtr native);
static BlockCommandComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
BlockCommandComment(); BlockCommandComment();
BlockCommandComment(CppSharp::Parser::AST::CommentKind Kind); BlockCommandComment(CppSharp::Parser::AST::CommentKind Kind);
@ -2566,6 +2626,7 @@ namespace CppSharp
ParamCommandComment(::CppSharp::CppParser::AST::ParamCommandComment* native); ParamCommandComment(::CppSharp::CppParser::AST::ParamCommandComment* native);
static ParamCommandComment^ __CreateInstance(::System::IntPtr native); static ParamCommandComment^ __CreateInstance(::System::IntPtr native);
static ParamCommandComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ParamCommandComment(); ParamCommandComment();
ParamCommandComment(CppSharp::Parser::AST::ParamCommandComment^ _0); ParamCommandComment(CppSharp::Parser::AST::ParamCommandComment^ _0);
@ -2591,6 +2652,7 @@ namespace CppSharp
TParamCommandComment(::CppSharp::CppParser::AST::TParamCommandComment* native); TParamCommandComment(::CppSharp::CppParser::AST::TParamCommandComment* native);
static TParamCommandComment^ __CreateInstance(::System::IntPtr native); static TParamCommandComment^ __CreateInstance(::System::IntPtr native);
static TParamCommandComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TParamCommandComment(); TParamCommandComment();
TParamCommandComment(CppSharp::Parser::AST::TParamCommandComment^ _0); TParamCommandComment(CppSharp::Parser::AST::TParamCommandComment^ _0);
@ -2615,6 +2677,7 @@ namespace CppSharp
VerbatimBlockLineComment(::CppSharp::CppParser::AST::VerbatimBlockLineComment* native); VerbatimBlockLineComment(::CppSharp::CppParser::AST::VerbatimBlockLineComment* native);
static VerbatimBlockLineComment^ __CreateInstance(::System::IntPtr native); static VerbatimBlockLineComment^ __CreateInstance(::System::IntPtr native);
static VerbatimBlockLineComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
VerbatimBlockLineComment(); VerbatimBlockLineComment();
VerbatimBlockLineComment(CppSharp::Parser::AST::VerbatimBlockLineComment^ _0); VerbatimBlockLineComment(CppSharp::Parser::AST::VerbatimBlockLineComment^ _0);
@ -2634,6 +2697,7 @@ namespace CppSharp
VerbatimBlockComment(::CppSharp::CppParser::AST::VerbatimBlockComment* native); VerbatimBlockComment(::CppSharp::CppParser::AST::VerbatimBlockComment* native);
static VerbatimBlockComment^ __CreateInstance(::System::IntPtr native); static VerbatimBlockComment^ __CreateInstance(::System::IntPtr native);
static VerbatimBlockComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
VerbatimBlockComment(); VerbatimBlockComment();
VerbatimBlockComment(CppSharp::Parser::AST::VerbatimBlockComment^ _0); VerbatimBlockComment(CppSharp::Parser::AST::VerbatimBlockComment^ _0);
@ -2658,6 +2722,7 @@ namespace CppSharp
VerbatimLineComment(::CppSharp::CppParser::AST::VerbatimLineComment* native); VerbatimLineComment(::CppSharp::CppParser::AST::VerbatimLineComment* native);
static VerbatimLineComment^ __CreateInstance(::System::IntPtr native); static VerbatimLineComment^ __CreateInstance(::System::IntPtr native);
static VerbatimLineComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
VerbatimLineComment(); VerbatimLineComment();
VerbatimLineComment(CppSharp::Parser::AST::VerbatimLineComment^ _0); VerbatimLineComment(CppSharp::Parser::AST::VerbatimLineComment^ _0);
@ -2677,6 +2742,7 @@ namespace CppSharp
InlineContentComment(::CppSharp::CppParser::AST::InlineContentComment* native); InlineContentComment(::CppSharp::CppParser::AST::InlineContentComment* native);
static InlineContentComment^ __CreateInstance(::System::IntPtr native); static InlineContentComment^ __CreateInstance(::System::IntPtr native);
static InlineContentComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
InlineContentComment(); InlineContentComment();
InlineContentComment(CppSharp::Parser::AST::CommentKind Kind); InlineContentComment(CppSharp::Parser::AST::CommentKind Kind);
@ -2692,6 +2758,7 @@ namespace CppSharp
ParagraphComment(::CppSharp::CppParser::AST::ParagraphComment* native); ParagraphComment(::CppSharp::CppParser::AST::ParagraphComment* native);
static ParagraphComment^ __CreateInstance(::System::IntPtr native); static ParagraphComment^ __CreateInstance(::System::IntPtr native);
static ParagraphComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ParagraphComment(); ParagraphComment();
ParagraphComment(CppSharp::Parser::AST::ParagraphComment^ _0); ParagraphComment(CppSharp::Parser::AST::ParagraphComment^ _0);
@ -2741,6 +2808,7 @@ namespace CppSharp
Argument(::CppSharp::CppParser::AST::InlineCommandComment::Argument* native); Argument(::CppSharp::CppParser::AST::InlineCommandComment::Argument* native);
static Argument^ __CreateInstance(::System::IntPtr native); static Argument^ __CreateInstance(::System::IntPtr native);
static Argument^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Argument(); Argument();
Argument(CppSharp::Parser::AST::InlineCommandComment::Argument^ _0); Argument(CppSharp::Parser::AST::InlineCommandComment::Argument^ _0);
@ -2753,12 +2821,13 @@ namespace CppSharp
void set(System::String^); void set(System::String^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
InlineCommandComment(::CppSharp::CppParser::AST::InlineCommandComment* native); InlineCommandComment(::CppSharp::CppParser::AST::InlineCommandComment* native);
static InlineCommandComment^ __CreateInstance(::System::IntPtr native); static InlineCommandComment^ __CreateInstance(::System::IntPtr native);
static InlineCommandComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
InlineCommandComment(); InlineCommandComment();
InlineCommandComment(CppSharp::Parser::AST::InlineCommandComment^ _0); InlineCommandComment(CppSharp::Parser::AST::InlineCommandComment^ _0);
@ -2789,6 +2858,7 @@ namespace CppSharp
HTMLTagComment(::CppSharp::CppParser::AST::HTMLTagComment* native); HTMLTagComment(::CppSharp::CppParser::AST::HTMLTagComment* native);
static HTMLTagComment^ __CreateInstance(::System::IntPtr native); static HTMLTagComment^ __CreateInstance(::System::IntPtr native);
static HTMLTagComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
HTMLTagComment(); HTMLTagComment();
HTMLTagComment(CppSharp::Parser::AST::CommentKind Kind); HTMLTagComment(CppSharp::Parser::AST::CommentKind Kind);
@ -2815,6 +2885,7 @@ namespace CppSharp
Attribute(::CppSharp::CppParser::AST::HTMLStartTagComment::Attribute* native); Attribute(::CppSharp::CppParser::AST::HTMLStartTagComment::Attribute* native);
static Attribute^ __CreateInstance(::System::IntPtr native); static Attribute^ __CreateInstance(::System::IntPtr native);
static Attribute^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
Attribute(); Attribute();
Attribute(CppSharp::Parser::AST::HTMLStartTagComment::Attribute^ _0); Attribute(CppSharp::Parser::AST::HTMLStartTagComment::Attribute^ _0);
@ -2833,12 +2904,13 @@ namespace CppSharp
void set(System::String^); void set(System::String^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
HTMLStartTagComment(::CppSharp::CppParser::AST::HTMLStartTagComment* native); HTMLStartTagComment(::CppSharp::CppParser::AST::HTMLStartTagComment* native);
static HTMLStartTagComment^ __CreateInstance(::System::IntPtr native); static HTMLStartTagComment^ __CreateInstance(::System::IntPtr native);
static HTMLStartTagComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
HTMLStartTagComment(); HTMLStartTagComment();
HTMLStartTagComment(CppSharp::Parser::AST::HTMLStartTagComment^ _0); HTMLStartTagComment(CppSharp::Parser::AST::HTMLStartTagComment^ _0);
@ -2869,6 +2941,7 @@ namespace CppSharp
HTMLEndTagComment(::CppSharp::CppParser::AST::HTMLEndTagComment* native); HTMLEndTagComment(::CppSharp::CppParser::AST::HTMLEndTagComment* native);
static HTMLEndTagComment^ __CreateInstance(::System::IntPtr native); static HTMLEndTagComment^ __CreateInstance(::System::IntPtr native);
static HTMLEndTagComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
HTMLEndTagComment(); HTMLEndTagComment();
HTMLEndTagComment(CppSharp::Parser::AST::HTMLEndTagComment^ _0); HTMLEndTagComment(CppSharp::Parser::AST::HTMLEndTagComment^ _0);
@ -2888,6 +2961,7 @@ namespace CppSharp
TextComment(::CppSharp::CppParser::AST::TextComment* native); TextComment(::CppSharp::CppParser::AST::TextComment* native);
static TextComment^ __CreateInstance(::System::IntPtr native); static TextComment^ __CreateInstance(::System::IntPtr native);
static TextComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
TextComment(); TextComment();
TextComment(CppSharp::Parser::AST::TextComment^ _0); TextComment(CppSharp::Parser::AST::TextComment^ _0);
@ -2914,6 +2988,7 @@ namespace CppSharp
RawComment(::CppSharp::CppParser::AST::RawComment* native); RawComment(::CppSharp::CppParser::AST::RawComment* native);
static RawComment^ __CreateInstance(::System::IntPtr native); static RawComment^ __CreateInstance(::System::IntPtr native);
static RawComment^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
RawComment(); RawComment();
RawComment(CppSharp::Parser::AST::RawComment^ _0); RawComment(CppSharp::Parser::AST::RawComment^ _0);
@ -2944,7 +3019,7 @@ namespace CppSharp
void set(CppSharp::Parser::AST::FullComment^); void set(CppSharp::Parser::AST::FullComment^);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
} }

52
src/CppParser/Bindings/CLI/CppParser.cpp

@ -13,7 +13,14 @@ CppSharp::Parser::ParserOptions::ParserOptions(::CppSharp::CppParser::ParserOpti
CppSharp::Parser::ParserOptions^ CppSharp::Parser::ParserOptions::__CreateInstance(::System::IntPtr native) CppSharp::Parser::ParserOptions^ CppSharp::Parser::ParserOptions::__CreateInstance(::System::IntPtr native)
{ {
return gcnew ::CppSharp::Parser::ParserOptions((::CppSharp::CppParser::ParserOptions*) native.ToPointer()); return ::CppSharp::Parser::ParserOptions::__CreateInstance(native, false);
}
CppSharp::Parser::ParserOptions^ CppSharp::Parser::ParserOptions::__CreateInstance(::System::IntPtr native, bool __ownsNativeInstance)
{
::CppSharp::Parser::ParserOptions^ result = gcnew ::CppSharp::Parser::ParserOptions((::CppSharp::CppParser::ParserOptions*) native.ToPointer());
result->__ownsNativeInstance = __ownsNativeInstance;
return result;
} }
CppSharp::Parser::ParserOptions::~ParserOptions() CppSharp::Parser::ParserOptions::~ParserOptions()
@ -23,8 +30,8 @@ CppSharp::Parser::ParserOptions::~ParserOptions()
} }
CppSharp::Parser::ParserOptions::ParserOptions() CppSharp::Parser::ParserOptions::ParserOptions()
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
NativePtr = new ::CppSharp::CppParser::ParserOptions(); NativePtr = new ::CppSharp::CppParser::ParserOptions();
} }
@ -143,8 +150,8 @@ void CppSharp::Parser::ParserOptions::clearLibraryDirs()
} }
CppSharp::Parser::ParserOptions::ParserOptions(CppSharp::Parser::ParserOptions^ _0) CppSharp::Parser::ParserOptions::ParserOptions(CppSharp::Parser::ParserOptions^ _0)
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
auto &arg0 = *(::CppSharp::CppParser::ParserOptions*)_0->NativePtr; auto &arg0 = *(::CppSharp::CppParser::ParserOptions*)_0->NativePtr;
NativePtr = new ::CppSharp::CppParser::ParserOptions(arg0); NativePtr = new ::CppSharp::CppParser::ParserOptions(arg0);
} }
@ -311,7 +318,14 @@ CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(::CppSharp::CppParser::Pars
CppSharp::Parser::ParserDiagnostic^ CppSharp::Parser::ParserDiagnostic::__CreateInstance(::System::IntPtr native) CppSharp::Parser::ParserDiagnostic^ CppSharp::Parser::ParserDiagnostic::__CreateInstance(::System::IntPtr native)
{ {
return gcnew ::CppSharp::Parser::ParserDiagnostic((::CppSharp::CppParser::ParserDiagnostic*) native.ToPointer()); return ::CppSharp::Parser::ParserDiagnostic::__CreateInstance(native, false);
}
CppSharp::Parser::ParserDiagnostic^ CppSharp::Parser::ParserDiagnostic::__CreateInstance(::System::IntPtr native, bool __ownsNativeInstance)
{
::CppSharp::Parser::ParserDiagnostic^ result = gcnew ::CppSharp::Parser::ParserDiagnostic((::CppSharp::CppParser::ParserDiagnostic*) native.ToPointer());
result->__ownsNativeInstance = __ownsNativeInstance;
return result;
} }
CppSharp::Parser::ParserDiagnostic::~ParserDiagnostic() CppSharp::Parser::ParserDiagnostic::~ParserDiagnostic()
@ -321,14 +335,14 @@ CppSharp::Parser::ParserDiagnostic::~ParserDiagnostic()
} }
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic() CppSharp::Parser::ParserDiagnostic::ParserDiagnostic()
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
NativePtr = new ::CppSharp::CppParser::ParserDiagnostic(); NativePtr = new ::CppSharp::CppParser::ParserDiagnostic();
} }
CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(CppSharp::Parser::ParserDiagnostic^ _0) CppSharp::Parser::ParserDiagnostic::ParserDiagnostic(CppSharp::Parser::ParserDiagnostic^ _0)
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
auto &arg0 = *(::CppSharp::CppParser::ParserDiagnostic*)_0->NativePtr; auto &arg0 = *(::CppSharp::CppParser::ParserDiagnostic*)_0->NativePtr;
NativePtr = new ::CppSharp::CppParser::ParserDiagnostic(arg0); NativePtr = new ::CppSharp::CppParser::ParserDiagnostic(arg0);
} }
@ -409,7 +423,14 @@ CppSharp::Parser::ParserResult::ParserResult(::CppSharp::CppParser::ParserResult
CppSharp::Parser::ParserResult^ CppSharp::Parser::ParserResult::__CreateInstance(::System::IntPtr native) CppSharp::Parser::ParserResult^ CppSharp::Parser::ParserResult::__CreateInstance(::System::IntPtr native)
{ {
return gcnew ::CppSharp::Parser::ParserResult((::CppSharp::CppParser::ParserResult*) native.ToPointer()); return ::CppSharp::Parser::ParserResult::__CreateInstance(native, false);
}
CppSharp::Parser::ParserResult^ CppSharp::Parser::ParserResult::__CreateInstance(::System::IntPtr native, bool __ownsNativeInstance)
{
::CppSharp::Parser::ParserResult^ result = gcnew ::CppSharp::Parser::ParserResult((::CppSharp::CppParser::ParserResult*) native.ToPointer());
result->__ownsNativeInstance = __ownsNativeInstance;
return result;
} }
CppSharp::Parser::ParserResult::~ParserResult() CppSharp::Parser::ParserResult::~ParserResult()
@ -419,14 +440,14 @@ CppSharp::Parser::ParserResult::~ParserResult()
} }
CppSharp::Parser::ParserResult::ParserResult() CppSharp::Parser::ParserResult::ParserResult()
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
NativePtr = new ::CppSharp::CppParser::ParserResult(); NativePtr = new ::CppSharp::CppParser::ParserResult();
} }
CppSharp::Parser::ParserResult::ParserResult(CppSharp::Parser::ParserResult^ _0) CppSharp::Parser::ParserResult::ParserResult(CppSharp::Parser::ParserResult^ _0)
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
auto &arg0 = *(::CppSharp::CppParser::ParserResult*)_0->NativePtr; auto &arg0 = *(::CppSharp::CppParser::ParserResult*)_0->NativePtr;
NativePtr = new ::CppSharp::CppParser::ParserResult(arg0); NativePtr = new ::CppSharp::CppParser::ParserResult(arg0);
} }
@ -503,7 +524,14 @@ CppSharp::Parser::ClangParser::ClangParser(::CppSharp::CppParser::ClangParser* n
CppSharp::Parser::ClangParser^ CppSharp::Parser::ClangParser::__CreateInstance(::System::IntPtr native) CppSharp::Parser::ClangParser^ CppSharp::Parser::ClangParser::__CreateInstance(::System::IntPtr native)
{ {
return gcnew ::CppSharp::Parser::ClangParser((::CppSharp::CppParser::ClangParser*) native.ToPointer()); return ::CppSharp::Parser::ClangParser::__CreateInstance(native, false);
}
CppSharp::Parser::ClangParser^ CppSharp::Parser::ClangParser::__CreateInstance(::System::IntPtr native, bool __ownsNativeInstance)
{
::CppSharp::Parser::ClangParser^ result = gcnew ::CppSharp::Parser::ClangParser((::CppSharp::CppParser::ClangParser*) native.ToPointer());
result->__ownsNativeInstance = __ownsNativeInstance;
return result;
} }
CppSharp::Parser::ClangParser::~ClangParser() CppSharp::Parser::ClangParser::~ClangParser()
@ -537,14 +565,14 @@ CppSharp::Parser::ParserTargetInfo^ CppSharp::Parser::ClangParser::GetTargetInfo
} }
CppSharp::Parser::ClangParser::ClangParser() CppSharp::Parser::ClangParser::ClangParser()
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
NativePtr = new ::CppSharp::CppParser::ClangParser(); NativePtr = new ::CppSharp::CppParser::ClangParser();
} }
CppSharp::Parser::ClangParser::ClangParser(CppSharp::Parser::ClangParser^ _0) CppSharp::Parser::ClangParser::ClangParser(CppSharp::Parser::ClangParser^ _0)
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
auto &arg0 = *(::CppSharp::CppParser::ClangParser*)_0->NativePtr; auto &arg0 = *(::CppSharp::CppParser::ClangParser*)_0->NativePtr;
NativePtr = new ::CppSharp::CppParser::ClangParser(arg0); NativePtr = new ::CppSharp::CppParser::ClangParser(arg0);
} }

12
src/CppParser/Bindings/CLI/CppParser.h

@ -78,6 +78,7 @@ namespace CppSharp
ParserOptions(::CppSharp::CppParser::ParserOptions* native); ParserOptions(::CppSharp::CppParser::ParserOptions* native);
static ParserOptions^ __CreateInstance(::System::IntPtr native); static ParserOptions^ __CreateInstance(::System::IntPtr native);
static ParserOptions^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ParserOptions(); ParserOptions();
ParserOptions(CppSharp::Parser::ParserOptions^ _0); ParserOptions(CppSharp::Parser::ParserOptions^ _0);
@ -210,7 +211,7 @@ namespace CppSharp
void clearLibraryDirs(); void clearLibraryDirs();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -227,6 +228,7 @@ namespace CppSharp
ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native); ParserDiagnostic(::CppSharp::CppParser::ParserDiagnostic* native);
static ParserDiagnostic^ __CreateInstance(::System::IntPtr native); static ParserDiagnostic^ __CreateInstance(::System::IntPtr native);
static ParserDiagnostic^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ParserDiagnostic(); ParserDiagnostic();
ParserDiagnostic(CppSharp::Parser::ParserDiagnostic^ _0); ParserDiagnostic(CppSharp::Parser::ParserDiagnostic^ _0);
@ -263,7 +265,7 @@ namespace CppSharp
void set(int); void set(int);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -280,6 +282,7 @@ namespace CppSharp
ParserResult(::CppSharp::CppParser::ParserResult* native); ParserResult(::CppSharp::CppParser::ParserResult* native);
static ParserResult^ __CreateInstance(::System::IntPtr native); static ParserResult^ __CreateInstance(::System::IntPtr native);
static ParserResult^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ParserResult(); ParserResult();
ParserResult(CppSharp::Parser::ParserResult^ _0); ParserResult(CppSharp::Parser::ParserResult^ _0);
@ -315,7 +318,7 @@ namespace CppSharp
void clearDiagnostics(); void clearDiagnostics();
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
@ -332,6 +335,7 @@ namespace CppSharp
ClangParser(::CppSharp::CppParser::ClangParser* native); ClangParser(::CppSharp::CppParser::ClangParser* native);
static ClangParser^ __CreateInstance(::System::IntPtr native); static ClangParser^ __CreateInstance(::System::IntPtr native);
static ClangParser^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ClangParser(); ClangParser();
ClangParser(CppSharp::Parser::ClangParser^ _0); ClangParser(CppSharp::Parser::ClangParser^ _0);
@ -344,7 +348,7 @@ namespace CppSharp
static CppSharp::Parser::ParserTargetInfo^ GetTargetInfo(CppSharp::Parser::ParserOptions^ Opts); static CppSharp::Parser::ParserTargetInfo^ GetTargetInfo(CppSharp::Parser::ParserOptions^ Opts);
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
} }

13
src/CppParser/Bindings/CLI/Target.cpp

@ -11,7 +11,14 @@ CppSharp::Parser::ParserTargetInfo::ParserTargetInfo(::CppSharp::CppParser::Pars
CppSharp::Parser::ParserTargetInfo^ CppSharp::Parser::ParserTargetInfo::__CreateInstance(::System::IntPtr native) CppSharp::Parser::ParserTargetInfo^ CppSharp::Parser::ParserTargetInfo::__CreateInstance(::System::IntPtr native)
{ {
return gcnew ::CppSharp::Parser::ParserTargetInfo((::CppSharp::CppParser::ParserTargetInfo*) native.ToPointer()); return ::CppSharp::Parser::ParserTargetInfo::__CreateInstance(native, false);
}
CppSharp::Parser::ParserTargetInfo^ CppSharp::Parser::ParserTargetInfo::__CreateInstance(::System::IntPtr native, bool __ownsNativeInstance)
{
::CppSharp::Parser::ParserTargetInfo^ result = gcnew ::CppSharp::Parser::ParserTargetInfo((::CppSharp::CppParser::ParserTargetInfo*) native.ToPointer());
result->__ownsNativeInstance = __ownsNativeInstance;
return result;
} }
CppSharp::Parser::ParserTargetInfo::~ParserTargetInfo() CppSharp::Parser::ParserTargetInfo::~ParserTargetInfo()
@ -21,14 +28,14 @@ CppSharp::Parser::ParserTargetInfo::~ParserTargetInfo()
} }
CppSharp::Parser::ParserTargetInfo::ParserTargetInfo() CppSharp::Parser::ParserTargetInfo::ParserTargetInfo()
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
NativePtr = new ::CppSharp::CppParser::ParserTargetInfo(); NativePtr = new ::CppSharp::CppParser::ParserTargetInfo();
} }
CppSharp::Parser::ParserTargetInfo::ParserTargetInfo(CppSharp::Parser::ParserTargetInfo^ _0) CppSharp::Parser::ParserTargetInfo::ParserTargetInfo(CppSharp::Parser::ParserTargetInfo^ _0)
: __ownsNativeInstance(true)
{ {
__ownsNativeInstance = true;
auto &arg0 = *(::CppSharp::CppParser::ParserTargetInfo*)_0->NativePtr; auto &arg0 = *(::CppSharp::CppParser::ParserTargetInfo*)_0->NativePtr;
NativePtr = new ::CppSharp::CppParser::ParserTargetInfo(arg0); NativePtr = new ::CppSharp::CppParser::ParserTargetInfo(arg0);
} }

3
src/CppParser/Bindings/CLI/Target.h

@ -44,6 +44,7 @@ namespace CppSharp
ParserTargetInfo(::CppSharp::CppParser::ParserTargetInfo* native); ParserTargetInfo(::CppSharp::CppParser::ParserTargetInfo* native);
static ParserTargetInfo^ __CreateInstance(::System::IntPtr native); static ParserTargetInfo^ __CreateInstance(::System::IntPtr native);
static ParserTargetInfo^ __CreateInstance(::System::IntPtr native, bool __ownsNativeInstance);
ParserTargetInfo(); ParserTargetInfo();
ParserTargetInfo(CppSharp::Parser::ParserTargetInfo^ _0); ParserTargetInfo(CppSharp::Parser::ParserTargetInfo^ _0);
@ -284,7 +285,7 @@ namespace CppSharp
void set(unsigned int); void set(unsigned int);
} }
private: protected:
bool __ownsNativeInstance; bool __ownsNativeInstance;
}; };
} }

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

File diff suppressed because it is too large Load Diff

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

@ -233,11 +233,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserOptions((ParserOptions.Internal*) native); return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserOptions __CreateInstance(ParserOptions.Internal native) public static ParserOptions __CreateInstance(ParserOptions.Internal native)
@ -663,11 +663,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserDiagnostic((ParserDiagnostic.Internal*) native); return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native)
@ -864,11 +864,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserResult((ParserResult.Internal*) native); return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserResult __CreateInstance(ParserResult.Internal native) public static ParserResult __CreateInstance(ParserResult.Internal native)
@ -1043,11 +1043,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ClangParser((ClangParser.Internal*) native); return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ClangParser __CreateInstance(ClangParser.Internal native) public static ClangParser __CreateInstance(ClangParser.Internal native)

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

@ -173,11 +173,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserTargetInfo((ParserTargetInfo.Internal*) native); return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native)

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

File diff suppressed because it is too large Load Diff

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

@ -233,11 +233,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserOptions((ParserOptions.Internal*) native); return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserOptions __CreateInstance(ParserOptions.Internal native) public static ParserOptions __CreateInstance(ParserOptions.Internal native)
@ -663,11 +663,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserDiagnostic((ParserDiagnostic.Internal*) native); return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native)
@ -864,11 +864,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserResult((ParserResult.Internal*) native); return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserResult __CreateInstance(ParserResult.Internal native) public static ParserResult __CreateInstance(ParserResult.Internal native)
@ -1043,11 +1043,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ClangParser((ClangParser.Internal*) native); return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ClangParser __CreateInstance(ClangParser.Internal native) public static ClangParser __CreateInstance(ClangParser.Internal native)

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

@ -173,11 +173,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserTargetInfo((ParserTargetInfo.Internal*) native); return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native)

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

File diff suppressed because it is too large Load Diff

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

@ -233,11 +233,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserOptions((ParserOptions.Internal*) native); return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserOptions __CreateInstance(ParserOptions.Internal native) public static ParserOptions __CreateInstance(ParserOptions.Internal native)
@ -663,11 +663,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserDiagnostic((ParserDiagnostic.Internal*) native); return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native)
@ -864,11 +864,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserResult((ParserResult.Internal*) native); return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserResult __CreateInstance(ParserResult.Internal native) public static ParserResult __CreateInstance(ParserResult.Internal native)
@ -1043,11 +1043,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ClangParser((ClangParser.Internal*) native); return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ClangParser __CreateInstance(ClangParser.Internal native) public static ClangParser __CreateInstance(ClangParser.Internal native)

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

@ -173,11 +173,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserTargetInfo((ParserTargetInfo.Internal*) native); return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native)

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

File diff suppressed because it is too large Load Diff

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

@ -233,11 +233,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserOptions>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserOptions __CreateInstance(global::System.IntPtr native) public static ParserOptions __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserOptions((ParserOptions.Internal*) native); return new ParserOptions((ParserOptions.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserOptions __CreateInstance(ParserOptions.Internal native) public static ParserOptions __CreateInstance(ParserOptions.Internal native)
@ -663,11 +663,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserDiagnostic>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserDiagnostic __CreateInstance(global::System.IntPtr native) public static ParserDiagnostic __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserDiagnostic((ParserDiagnostic.Internal*) native); return new ParserDiagnostic((ParserDiagnostic.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native) public static ParserDiagnostic __CreateInstance(ParserDiagnostic.Internal native)
@ -864,11 +864,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserResult>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserResult __CreateInstance(global::System.IntPtr native) public static ParserResult __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserResult((ParserResult.Internal*) native); return new ParserResult((ParserResult.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserResult __CreateInstance(ParserResult.Internal native) public static ParserResult __CreateInstance(ParserResult.Internal native)
@ -1043,11 +1043,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ClangParser>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ClangParser __CreateInstance(global::System.IntPtr native) public static ClangParser __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ClangParser((ClangParser.Internal*) native); return new ClangParser((ClangParser.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ClangParser __CreateInstance(ClangParser.Internal native) public static ClangParser __CreateInstance(ClangParser.Internal native)

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

@ -173,11 +173,11 @@ namespace CppSharp
public global::System.IntPtr __Instance { get; protected set; } 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>(); public static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo> NativeToManagedMap = new System.Collections.Concurrent.ConcurrentDictionary<IntPtr, ParserTargetInfo>();
private readonly bool __ownsNativeInstance; private bool __ownsNativeInstance;
public static ParserTargetInfo __CreateInstance(global::System.IntPtr native) public static ParserTargetInfo __CreateInstance(global::System.IntPtr native, bool ownsNativeInstance = false)
{ {
return new ParserTargetInfo((ParserTargetInfo.Internal*) native); return new ParserTargetInfo((ParserTargetInfo.Internal*) native) { __ownsNativeInstance = ownsNativeInstance };
} }
public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native) public static ParserTargetInfo __CreateInstance(ParserTargetInfo.Internal native)

19
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -270,14 +270,23 @@ namespace CppSharp.Generators.CLI
GenerateClassVariables(@class); GenerateClassVariables(@class);
if (CLIGenerator.ShouldGenerateClassNativeField(@class))
{
PushBlock(CLIBlockKind.AccessSpecifier);
WriteLine("protected:");
PopBlock(NewLineKind.IfNotEmpty);
PushBlock(CLIBlockKind.Fields);
WriteLineIndent("bool {0};", Helpers.OwnsNativeInstanceIdentifier);
PopBlock();
}
PushBlock(CLIBlockKind.AccessSpecifier); PushBlock(CLIBlockKind.AccessSpecifier);
WriteLine("private:"); WriteLine("private:");
var accBlock = PopBlock(NewLineKind.IfNotEmpty); var accBlock = PopBlock(NewLineKind.IfNotEmpty);
PushBlock(CLIBlockKind.Fields); PushBlock(CLIBlockKind.Fields);
GenerateClassFields(@class); GenerateClassFields(@class);
if (CLIGenerator.ShouldGenerateClassNativeField(@class))
WriteLineIndent("bool {0};", Helpers.OwnsNativeInstanceIdentifier);
var fieldsBlock = PopBlock(); var fieldsBlock = PopBlock();
accBlock.CheckGenerate = () => !fieldsBlock.IsEmpty; accBlock.CheckGenerate = () => !fieldsBlock.IsEmpty;
@ -370,7 +379,11 @@ namespace CppSharp.Generators.CLI
// Output a default constructor that takes the native pointer. // Output a default constructor that takes the native pointer.
WriteLine("{0}({1} native);", @class.Name, nativeType); WriteLine("{0}({1} native);", @class.Name, nativeType);
WriteLine("static {0}^ {1}(::System::IntPtr native);", @class.Name, Helpers.CreateInstanceIdentifier); WriteLine("static {0}^ {1}(::System::IntPtr native);",
@class.Name, Helpers.CreateInstanceIdentifier);
if (@class.IsRefType)
WriteLine("static {0}^ {1}(::System::IntPtr native, bool {2});",
@class.Name, Helpers.CreateInstanceIdentifier, Helpers.OwnsNativeInstanceIdentifier);
foreach (var ctor in @class.Constructors) foreach (var ctor in @class.Constructors)
{ {

51
src/Generator/Generators/CLI/CLISourcesTemplate.cs

@ -638,7 +638,14 @@ namespace CppSharp.Generators.CLI
var hasBase = GenerateClassConstructorBase(@class); var hasBase = GenerateClassConstructorBase(@class);
InitialiseOwnsNativeInstance(@class, hasBase, false); if (CLIGenerator.ShouldGenerateClassNativeField(@class))
{
PushIndent();
Write(hasBase ? "," : ":");
PopIndent();
WriteLine(" {0}(false)", Helpers.OwnsNativeInstanceIdentifier);
}
WriteStartBraceIndent(); WriteStartBraceIndent();
@ -658,25 +665,33 @@ namespace CppSharp.Generators.CLI
WriteCloseBraceIndent(); WriteCloseBraceIndent();
NewLine(); NewLine();
WriteLine("{0}^ {0}::{1}(::System::IntPtr native)", qualifiedIdentifier, Helpers.CreateInstanceIdentifier); WriteLine("{0}^ {0}::{1}(::System::IntPtr native)", qualifiedIdentifier, Helpers.CreateInstanceIdentifier);
WriteStartBraceIndent(); WriteStartBraceIndent();
WriteLine("return gcnew ::{0}(({1}) native.ToPointer());", qualifiedIdentifier, nativeType);
WriteCloseBraceIndent();
NewLine();
}
private void InitialiseOwnsNativeInstance(Class @class, bool hasBase, bool ownsNativeInstance) if (@class.IsRefType)
{ {
if (!CLIGenerator.ShouldGenerateClassNativeField(@class)) return; WriteLine("return ::{0}::{1}(native, false);",
qualifiedIdentifier, Helpers.CreateInstanceIdentifier);
WriteCloseBraceIndent();
NewLine();
PushIndent(); WriteLine("{0}^ {0}::{1}(::System::IntPtr native, bool {2})",
Write(hasBase ? "," : ":"); qualifiedIdentifier, Helpers.CreateInstanceIdentifier, Helpers.OwnsNativeInstanceIdentifier);
PopIndent();
WriteLine(" {0}({1})", Helpers.OwnsNativeInstanceIdentifier, WriteStartBraceIndent();
ownsNativeInstance ? "true" : "false"); WriteLine("::{0}^ result = gcnew ::{0}(({1}) native.ToPointer());", qualifiedIdentifier, nativeType);
if (@class.IsRefType)
WriteLine("result->{0} = {0};", Helpers.OwnsNativeInstanceIdentifier);
WriteLine("return result;");
}
else
{
WriteLine("return gcnew ::{0}(({1}) native.ToPointer());", qualifiedIdentifier, nativeType);
}
WriteCloseBraceIndent();
NewLine();
} }
private void GenerateStructMarshaling(Class @class, string nativeVar) private void GenerateStructMarshaling(Class @class, string nativeVar)
@ -758,15 +773,15 @@ namespace CppSharp.Generators.CLI
WriteLine(")"); WriteLine(")");
if (method.IsConstructor) if (method.IsConstructor)
{ GenerateClassConstructorBase(@class, method: method);
var hasBase = GenerateClassConstructorBase(@class, method: method);
InitialiseOwnsNativeInstance(@class, hasBase, true);
}
WriteStartBraceIndent(); WriteStartBraceIndent();
PushBlock(CLIBlockKind.MethodBody, method); PushBlock(CLIBlockKind.MethodBody, method);
if (method.IsConstructor && @class.IsRefType)
WriteLine("{0} = true;", Helpers.OwnsNativeInstanceIdentifier);
if (method.IsProxy) if (method.IsProxy)
goto SkipImpl; goto SkipImpl;

12
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -1864,7 +1864,7 @@ namespace CppSharp.Generators.CSharp
if (@class.IsRefType) if (@class.IsRefType)
{ {
PushBlock(CSharpBlockKind.Field); PushBlock(CSharpBlockKind.Field);
WriteLine("private readonly bool {0};", Helpers.OwnsNativeInstanceIdentifier); WriteLine("private bool {0};", Helpers.OwnsNativeInstanceIdentifier);
PopBlock(NewLineKind.BeforeNextBlock); PopBlock(NewLineKind.BeforeNextBlock);
} }
@ -1874,11 +1874,15 @@ namespace CppSharp.Generators.CSharp
if (!@class.IsAbstractImpl) if (!@class.IsAbstractImpl)
{ {
PushBlock(CSharpBlockKind.Method); PushBlock(CSharpBlockKind.Method);
WriteLine("public static {0}{1} {2}(global::System.IntPtr native)", WriteLine("public static {0}{1} {2}(global::System.IntPtr native{3})",
@class.HasNonIgnoredBase && !@class.BaseClass.IsAbstract ? "new " : string.Empty, @class.HasNonIgnoredBase && !@class.BaseClass.IsAbstract ? "new " : string.Empty,
@class.Name, Helpers.CreateInstanceIdentifier); @class.Name, Helpers.CreateInstanceIdentifier,
@class.IsRefType ? ", bool ownsNativeInstance = false" : string.Empty);
WriteStartBraceIndent(); WriteStartBraceIndent();
WriteLine("return new {0}(({1}.Internal*) native);", ctorCall, className); WriteLine("return new {0}(({1}.Internal*) native){2};", ctorCall, className,
@class.IsRefType
? string.Format(" {{ {0} = ownsNativeInstance }}", Helpers.OwnsNativeInstanceIdentifier)
: string.Empty);
WriteCloseBraceIndent(); WriteCloseBraceIndent();
PopBlock(NewLineKind.BeforeNextBlock); PopBlock(NewLineKind.BeforeNextBlock);
} }

Loading…
Cancel
Save