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

Loading…
Cancel
Save