Browse Source

Reorganized declarations. Added flag to see if type should be treated as opaque. Added flag to see if type is an union.

pull/1/head
triton 13 years ago
parent
commit
4c25413588
  1. 52
      src/Bridge/Class.cs

52
src/Bridge/Class.cs

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Cxxi namespace Cxxi
@ -14,6 +13,10 @@ namespace Cxxi
// Represents a base class of a C++ class. // Represents a base class of a C++ class.
public class BaseClassSpecifier public class BaseClassSpecifier
{ {
public Class Class { get; set; }
public AccessSpecifier Access { get; set; }
public bool IsVirtual { get; set; }
BaseClassSpecifier(Class @class, AccessSpecifier access, BaseClassSpecifier(Class @class, AccessSpecifier access,
bool isVirtual = false) bool isVirtual = false)
{ {
@ -21,10 +24,6 @@ namespace Cxxi
Access = access; Access = access;
IsVirtual = isVirtual; IsVirtual = isVirtual;
} }
public Class Class { get; set; }
public AccessSpecifier Access { get; set; }
public bool IsVirtual { get; set; }
} }
// Represents a C++ virtual function table. // Represents a C++ virtual function table.
@ -51,18 +50,6 @@ namespace Cxxi
// Represents a C++ record declaration. // Represents a C++ record declaration.
public class Class : Declaration public class Class : Declaration
{ {
public Class()
{
Bases = new List<BaseClassSpecifier>();
Fields = new List<Field>();
Properties = new List<Property>();
Methods = new List<Method>();
NestedClasses = new List<Class>();
NestedEnums = new List<Enumeration>();
IsAbstract = false;
}
public List<BaseClassSpecifier> Bases; public List<BaseClassSpecifier> Bases;
public List<Class> NestedClasses; public List<Class> NestedClasses;
public List<Enumeration> NestedEnums; public List<Enumeration> NestedEnums;
@ -70,11 +57,6 @@ namespace Cxxi
public List<Property> Properties; public List<Property> Properties;
public List<Method> Methods; public List<Method> Methods;
public bool HasBase
{
get { return Bases.Count > 0; }
}
// True if the record is a POD (Plain Old Data) type. // True if the record is a POD (Plain Old Data) type.
public bool IsPOD; public bool IsPOD;
@ -82,9 +64,33 @@ namespace Cxxi
public List<ClassLayout> Layouts { get; set; } public List<ClassLayout> Layouts { get; set; }
// True if class only provides pure virtual methods. // True if class only provides pure virtual methods.
public bool IsAbstract { get; set; } public bool IsAbstract;
// True if the type is to be treated as a union.
public bool IsUnion;
// True if the type is to be treated as opaque.
public bool IsOpaque;
public string TemplateName { get; set; } public string TemplateName { get; set; }
public string TemplateClassName { get; set; } public string TemplateClassName { get; set; }
public Class()
{
Bases = new List<BaseClassSpecifier>();
Fields = new List<Field>();
Properties = new List<Property>();
Methods = new List<Method>();
NestedClasses = new List<Class>();
NestedEnums = new List<Enumeration>();
IsAbstract = false;
IsUnion = false;
IsOpaque = false;
}
public bool HasBase
{
get { return Bases.Count > 0; }
}
} }
} }
Loading…
Cancel
Save