class ObjCTypeParamDecl

Declaration

class ObjCTypeParamDecl : public TypedefNameDecl { /* full declaration omitted */ };

Description

Represents the declaration of an Objective-C type parameter. In the example above, both \c Key and \c Value are represented by\c ObjCTypeParamDecl. \c Key has an explicit bound of \c id<NSCopying>, while \c Value gets an implicit bound of \c id. Objective-C type parameters are typedef-names in the grammar,

Declared at: clang/include/clang/AST/DeclObjC.h:582

Inherits from: TypedefNameDecl

Member Variables

private unsigned int Index
Index of this type parameter in the type parameter list.
private unsigned int Variance
The variance of the type parameter.
private clang::SourceLocation VarianceLoc
The location of the variance, if any.
private clang::SourceLocation ColonLoc
The location of the ':', which will be valid when the bound was explicitly specified.

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • public static clang::ObjCTypeParamDecl * Create(clang::ASTContext & ctx, clang::DeclContext * dc, clang::ObjCTypeParamVariance variance, clang::SourceLocation varianceLoc, unsigned int index, clang::SourceLocation nameLoc, clang::IdentifierInfo * name, clang::SourceLocation colonLoc, clang::TypeSourceInfo * boundInfo)
  • public static clang::ObjCTypeParamDecl * CreateDeserialized(clang::ASTContext & ctx, unsigned int ID)
  • private ObjCTypeParamDecl(clang::ASTContext & ctx, clang::DeclContext * dc, clang::ObjCTypeParamVariance variance, clang::SourceLocation varianceLoc, unsigned int index, clang::SourceLocation nameLoc, clang::IdentifierInfo * name, clang::SourceLocation colonLoc, clang::TypeSourceInfo * boundInfo)
  • private void anchor()
  • public static bool classof(const clang::Decl * D)
  • public static bool classofKind(clang::Decl::Kind K)
  • public clang::SourceLocation getColonLoc() const
  • public unsigned int getIndex() const
  • public clang::SourceRange getSourceRange() const
  • public clang::ObjCTypeParamVariance getVariance() const
  • public clang::SourceLocation getVarianceLoc() const
  • public bool hasExplicitBound() const
  • public void setVariance(clang::ObjCTypeParamVariance variance)

Inherited from TypedefNameDecl:

Inherited from TypeDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::ObjCTypeParamDecl* Create(
    clang::ASTContext& ctx,
    clang::DeclContext* dc,
    clang::ObjCTypeParamVariance variance,
    clang::SourceLocation varianceLoc,
    unsigned int index,
    clang::SourceLocation nameLoc,
    clang::IdentifierInfo* name,
    clang::SourceLocation colonLoc,
    clang::TypeSourceInfo* boundInfo)

Declared at: clang/include/clang/AST/DeclObjC.h:612

Parameters

clang::ASTContext& ctx
clang::DeclContext* dc
clang::ObjCTypeParamVariance variance
clang::SourceLocation varianceLoc
unsigned int index
clang::SourceLocation nameLoc
clang::IdentifierInfo* name
clang::SourceLocation colonLoc
clang::TypeSourceInfo* boundInfo

static clang::ObjCTypeParamDecl*
CreateDeserialized(clang::ASTContext& ctx,
                   unsigned int ID)

Declared at: clang/include/clang/AST/DeclObjC.h:620

Parameters

clang::ASTContext& ctx
unsigned int ID

ObjCTypeParamDecl(
    clang::ASTContext& ctx,
    clang::DeclContext* dc,
    clang::ObjCTypeParamVariance variance,
    clang::SourceLocation varianceLoc,
    unsigned int index,
    clang::SourceLocation nameLoc,
    clang::IdentifierInfo* name,
    clang::SourceLocation colonLoc,
    clang::TypeSourceInfo* boundInfo)

Declared at: clang/include/clang/AST/DeclObjC.h:596

Parameters

clang::ASTContext& ctx
clang::DeclContext* dc
clang::ObjCTypeParamVariance variance
clang::SourceLocation varianceLoc
unsigned int index
clang::SourceLocation nameLoc
clang::IdentifierInfo* name
clang::SourceLocation colonLoc
clang::TypeSourceInfo* boundInfo

void anchor()

Declared at: clang/include/clang/AST/DeclObjC.h:606

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/DeclObjC.h:649

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/DeclObjC.h:650

Parameters

clang::Decl::Kind K

clang::SourceLocation getColonLoc() const

Description

Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bound.

Declared at: clang/include/clang/AST/DeclObjC.h:646

unsigned int getIndex() const

Description

Retrieve the index into its type parameter list.

Declared at: clang/include/clang/AST/DeclObjC.h:638

clang::SourceRange getSourceRange() const

Description

Source range that this declaration covers.

Declared at: clang/include/clang/AST/DeclObjC.h:622

clang::ObjCTypeParamVariance getVariance() const

Description

Determine the variance of this type parameter.

Declared at: clang/include/clang/AST/DeclObjC.h:625

clang::SourceLocation getVarianceLoc() const

Description

Retrieve the location of the variance keyword.

Declared at: clang/include/clang/AST/DeclObjC.h:635

bool hasExplicitBound() const

Description

Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".

Declared at: clang/include/clang/AST/DeclObjC.h:642

void setVariance(
    clang::ObjCTypeParamVariance variance)

Description

Set the variance of this type parameter.

Declared at: clang/include/clang/AST/DeclObjC.h:630

Parameters

clang::ObjCTypeParamVariance variance