Browse Source

Moved typedef declarations to their own file.

pull/719/head
Joao Matos 9 years ago
parent
commit
b117410729
  1. 34
      src/AST/Declaration.cs
  2. 36
      src/AST/Typedef.cs

34
src/AST/Declaration.cs

@ -365,40 +365,6 @@ namespace CppSharp.AST @@ -365,40 +365,6 @@ namespace CppSharp.AST
public abstract T Visit<T>(IDeclVisitor<T> visitor);
}
/// <summary>
/// Base class for declarations which introduce a typedef-name.
/// </summary>
public abstract class TypedefNameDecl : Declaration, ITypedDecl
{
public Type Type { get { return QualifiedType.Type; } }
public QualifiedType QualifiedType { get; set; }
public bool IsSynthetized { get; set; }
}
/// <summary>
/// Represents a type definition in C++.
/// </summary>
public class TypedefDecl : TypedefNameDecl
{
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitTypedefDecl(this);
}
}
/// <summary>
/// Represents a type alias in C++.
/// </summary>
public class TypeAlias : TypedefNameDecl
{
public TypeAliasTemplate DescribedAliasTemplate { get; set; }
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitTypeAliasDecl(this);
}
}
public interface IDeclVisitor<out T>
{
T VisitDeclaration(Declaration decl);

36
src/AST/Typedef.cs

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
namespace CppSharp.AST
{
/// <summary>
/// Base class for declarations which introduce a typedef-name.
/// </summary>
public abstract class TypedefNameDecl : Declaration, ITypedDecl
{
public Type Type { get { return QualifiedType.Type; } }
public QualifiedType QualifiedType { get; set; }
public bool IsSynthetized { get; set; }
}
/// <summary>
/// Represents a type definition in C++.
/// </summary>
public class TypedefDecl : TypedefNameDecl
{
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitTypedefDecl(this);
}
}
/// <summary>
/// Represents a type alias in C++.
/// </summary>
public class TypeAlias : TypedefNameDecl
{
public TypeAliasTemplate DescribedAliasTemplate { get; set; }
public override T Visit<T>(IDeclVisitor<T> visitor)
{
return visitor.VisitTypeAliasDecl(this);
}
}
}
Loading…
Cancel
Save