Browse Source

Add set of generated declarations to CLITypeReferences.

pull/1514/head
Joao Matos 5 years ago committed by João Matos
parent
commit
0c0c4be9ca
  1. 6
      src/Generator/Generators/CLI/CLITypeReferences.cs

6
src/Generator/Generators/CLI/CLITypeReferences.cs

@ -36,11 +36,14 @@ namespace CppSharp.Generators.CLI @@ -36,11 +36,14 @@ namespace CppSharp.Generators.CLI
get { return typeReferences.Values; }
}
public HashSet<Declaration> GeneratedDeclarations;
public CLITypeReferenceCollector(ITypeMapDatabase typeMapDatabase, DriverOptions driverOptions)
{
TypeMapDatabase = typeMapDatabase;
DriverOptions = driverOptions;
typeReferences = new Dictionary<Declaration, CLITypeReference>();
GeneratedDeclarations = new HashSet<Declaration>();
}
public CLITypeReference GetTypeReference(Declaration decl)
@ -194,6 +197,9 @@ namespace CppSharp.Generators.CLI @@ -194,6 +197,9 @@ namespace CppSharp.Generators.CLI
if (@class.IsIncomplete && @class.CompleteDeclaration != null)
@class = (Class) @class.CompleteDeclaration;
if (@class.TranslationUnit == TranslationUnit)
GeneratedDeclarations.Add(@class);
string keywords;
if (DriverOptions.IsCLIGenerator)
keywords = @class.IsValueType ? "value struct" : "ref class";

Loading…
Cancel
Save