diff --git a/src/Generator/BindingContext.cs b/src/Generator/BindingContext.cs index 557020b9..9f763e55 100644 --- a/src/Generator/BindingContext.cs +++ b/src/Generator/BindingContext.cs @@ -17,7 +17,7 @@ namespace CppSharp.Generators public ParserTargetInfo TargetInfo { get; set; } public SymbolContext Symbols { get; private set; } - public TypeMapDatabase TypeDatabase { get; private set; } + public TypeMapDatabase TypeMaps { get; private set; } public PassBuilder TranslationUnitPasses { get; private set; } public PassBuilder GeneratorOutputPasses { get; private set; } @@ -36,8 +36,8 @@ namespace CppSharp.Generators Symbols = new SymbolContext(); Delegates = new Dictionary(); - TypeDatabase = new TypeMapDatabase(); - TypeDatabase.SetupTypeMaps(Options.GeneratorKind); + TypeMaps = new TypeMapDatabase(); + TypeMaps.SetupTypeMaps(Options.GeneratorKind); TranslationUnitPasses = new PassBuilder(this); GeneratorOutputPasses = new PassBuilder(this); diff --git a/src/Generator/Generators/CLI/CLIHeaders.cs b/src/Generator/Generators/CLI/CLIHeaders.cs index a9a23553..ec2c3dde 100644 --- a/src/Generator/Generators/CLI/CLIHeaders.cs +++ b/src/Generator/Generators/CLI/CLIHeaders.cs @@ -52,7 +52,7 @@ namespace CppSharp.Generators.CLI public void GenerateIncludeForwardRefs() { - var typeReferenceCollector = new CLITypeReferenceCollector(Context.TypeDatabase, + var typeReferenceCollector = new CLITypeReferenceCollector(Context.TypeMaps, Context.Options); typeReferenceCollector.Process(TranslationUnit, filterNamespaces: false); @@ -131,7 +131,7 @@ namespace CppSharp.Generators.CLI public void GenerateForwardRefs() { - var typeReferenceCollector = new CLITypeReferenceCollector(Context.TypeDatabase, + var typeReferenceCollector = new CLITypeReferenceCollector(Context.TypeMaps, Context.Options); typeReferenceCollector.Process(TranslationUnit); diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index ea09050d..d04ecd0e 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -20,7 +20,7 @@ namespace CppSharp.Generators.CLI public override bool VisitType(Type type, TypeQualifiers quals) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = type; typeMap.CLIMarshalToManaged(Context); @@ -155,7 +155,7 @@ namespace CppSharp.Generators.CLI } TypeMap typeMap = null; - Context.Context.TypeDatabase.FindTypeMap(pointee, out typeMap); + Context.Context.TypeMaps.FindTypeMap(pointee, out typeMap); Class @class; if (pointee.TryGetClass(out @class) && typeMap == null) @@ -237,7 +237,7 @@ namespace CppSharp.Generators.CLI var decl = typedef.Declaration; TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = typedef; typeMap.CLIMarshalToManaged(Context); @@ -262,7 +262,7 @@ namespace CppSharp.Generators.CLI TypeQualifiers quals) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; typeMap.CLIMarshalToManaged(Context); @@ -426,7 +426,7 @@ namespace CppSharp.Generators.CLI public override bool VisitType(Type type, TypeQualifiers quals) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = type; typeMap.CLIMarshalToNative(Context); @@ -611,7 +611,7 @@ namespace CppSharp.Generators.CLI var decl = typedef.Declaration; TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) { typeMap.CLIMarshalToNative(Context); return typeMap.IsValueType; @@ -647,7 +647,7 @@ namespace CppSharp.Generators.CLI TypeQualifiers quals) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(template, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = template; typeMap.CLIMarshalToNative(Context); @@ -693,7 +693,7 @@ namespace CppSharp.Generators.CLI private void MarshalRefClass(Class @class) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(@class, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(@class, out typeMap) && typeMap.DoesMarshalling) { typeMap.CLIMarshalToNative(Context); return; diff --git a/src/Generator/Generators/CLI/CLISources.cs b/src/Generator/Generators/CLI/CLISources.cs index 172ac8a0..37f393b4 100644 --- a/src/Generator/Generators/CLI/CLISources.cs +++ b/src/Generator/Generators/CLI/CLISources.cs @@ -60,7 +60,7 @@ namespace CppSharp.Generators.CLI { PushBlock(CLIBlockKind.IncludesForwardReferences); - var typeReferenceCollector = new CLITypeReferenceCollector(Context.TypeDatabase, Context.Options); + var typeReferenceCollector = new CLITypeReferenceCollector(Context.TypeMaps, Context.Options); typeReferenceCollector.Process(TranslationUnit, filterNamespaces: false); var includes = new SortedSet(StringComparer.InvariantCulture); diff --git a/src/Generator/Generators/CLI/CLITypePrinter.cs b/src/Generator/Generators/CLI/CLITypePrinter.cs index 0e2ca68e..dcb3af3d 100644 --- a/src/Generator/Generators/CLI/CLITypePrinter.cs +++ b/src/Generator/Generators/CLI/CLITypePrinter.cs @@ -28,7 +28,7 @@ namespace CppSharp.Generators.CLI public BindingContext Context { get; private set; } public DriverOptions Options { get { return Context.Options; } } - public TypeMapDatabase TypeMapDatabase { get { return Context.TypeDatabase; } } + public TypeMapDatabase TypeMapDatabase { get { return Context.TypeMaps; } } public CLITypePrinter(BindingContext context) { diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index aaa450da..064a3a21 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -64,7 +64,7 @@ namespace CppSharp.Generators.CSharp public override bool VisitType(Type type, TypeQualifiers quals) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = type; typeMap.CSharpMarshalToManaged(Context); @@ -77,7 +77,7 @@ namespace CppSharp.Generators.CSharp public override bool VisitDeclaration(Declaration decl) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) { typeMap.Declaration = decl; typeMap.CSharpMarshalToManaged(Context); @@ -382,7 +382,7 @@ namespace CppSharp.Generators.CSharp public override bool VisitType(Type type, TypeQualifiers quals) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(type, out typeMap) && typeMap.DoesMarshalling) { typeMap.Type = type; typeMap.CSharpMarshalToNative(Context); @@ -395,7 +395,7 @@ namespace CppSharp.Generators.CSharp public override bool VisitDeclaration(Declaration decl) { TypeMap typeMap; - if (Context.Context.TypeDatabase.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) + if (Context.Context.TypeMaps.FindTypeMap(decl, out typeMap) && typeMap.DoesMarshalling) { typeMap.Declaration = decl; typeMap.CSharpMarshalToNative(Context); diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index b1159fb6..9473d10f 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -432,11 +432,11 @@ namespace CppSharp.Generators.CSharp GenerateClassTemplateSpecializationInternal(nestedTemplate); System.Type typeMap = null; - if (Context.TypeDatabase.TypeMaps.ContainsKey(@class.Name)) + if (Context.TypeMaps.TypeMaps.ContainsKey(@class.Name)) { - typeMap = Context.TypeDatabase.TypeMaps[@class.Name]; + typeMap = Context.TypeMaps.TypeMaps[@class.Name]; // disable the type map for the mapped class itself so that operator params are not mapped - Context.TypeDatabase.TypeMaps.Remove(@class.Name); + Context.TypeMaps.TypeMaps.Remove(@class.Name); } PushBlock(CSharpBlockKind.Class); @@ -506,7 +506,7 @@ namespace CppSharp.Generators.CSharp PopBlock(NewLineKind.BeforeNextBlock); if (typeMap != null) - Context.TypeDatabase.TypeMaps.Add(@class.Name, typeMap); + Context.TypeMaps.TypeMaps.Add(@class.Name, typeMap); } private void GenerateClassMarshals(Class @class) @@ -760,7 +760,7 @@ namespace CppSharp.Generators.CSharp foreach (var @base in @class.Bases.Where(b => b.Class != null)) { TypeMap typeMap; - if ((!Context.TypeDatabase.FindTypeMap(@base.Type, out typeMap) && !@base.Class.IsDeclared) || + if ((!Context.TypeMaps.FindTypeMap(@base.Type, out typeMap) && !@base.Class.IsDeclared) || @base.Class.OriginalClass == @class) continue; @@ -2682,7 +2682,7 @@ namespace CppSharp.Generators.CSharp TypeMap typeMap; string construct = null; - if (Context.TypeDatabase.FindTypeMap(retClass, out typeMap)) + if (Context.TypeMaps.FindTypeMap(retClass, out typeMap)) construct = typeMap.CSharpConstruct(); if (construct == null) diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index bd1c56d0..5a8b0be6 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -70,7 +70,7 @@ namespace CppSharp.Generators.CSharp public BindingContext Context { get; set; } public DriverOptions Options { get { return Context.Options; } } - public TypeMapDatabase TypeMapDatabase { get { return Context.TypeDatabase; } } + public TypeMapDatabase TypeMapDatabase { get { return Context.TypeMaps; } } public CSharpTypePrinter(BindingContext context) { diff --git a/src/Generator/Passes/Pass.cs b/src/Generator/Passes/Pass.cs index 97112428..ce173baa 100644 --- a/src/Generator/Passes/Pass.cs +++ b/src/Generator/Passes/Pass.cs @@ -15,7 +15,7 @@ namespace CppSharp.Passes public IDiagnostics Diagnostics { get { return Context.Diagnostics; } } public DriverOptions Options { get { return Context.Options; } } public ASTContext ASTContext { get { return Context.ASTContext; } } - public TypeMapDatabase TypeDatabase { get { return Context.TypeDatabase; } } + public TypeMapDatabase TypeDatabase { get { return Context.TypeMaps; } } public bool ClearVisitedDeclarations = false;