class MSPropertyDecl

Declaration

class MSPropertyDecl : public DeclaratorDecl { /* full declaration omitted */ };

Description

An instance of this class represents the declaration of a property member. This is a Microsoft extension to C++, first introduced in Visual Studio .NET 2003 as a parallel to similar features in C# and Managed C++. A property must always be a non-static class member. A property member superficially resembles a non-static data member, except preceded by a property attribute: __declspec(property(get=GetX, put=PutX)) int x; Either (but not both) of the 'get' and 'put' names may be omitted. A reference to a property is always an lvalue. If the lvalue undergoes lvalue-to-rvalue conversion, then a getter name is required, and that member is called with no arguments. If the lvalue is assigned into, then a setter name is required, and that member is called with one argument, the value assigned. Both operations are potentially overloaded. Compound assignments are permitted, as are the increment and decrement operators. The getter and putter methods are permitted to be overloaded, although their return and parameter types are subject to certain restrictions according to the type of the property. A property declared using an incomplete array type may additionally be subscripted, adding extra parameters to the getter and putter methods.

Declared at: clang/include/clang/AST/DeclCXX.h:4120

Inherits from: DeclaratorDecl

Member Variables

private clang::IdentifierInfo* GetterId
private clang::IdentifierInfo* SetterId

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • public static clang::MSPropertyDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation L, clang::DeclarationName N, clang::QualType T, clang::TypeSourceInfo * TInfo, clang::SourceLocation StartL, clang::IdentifierInfo * Getter, clang::IdentifierInfo * Setter)
  • public static clang::MSPropertyDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
  • private MSPropertyDecl(clang::DeclContext * DC, clang::SourceLocation L, clang::DeclarationName N, clang::QualType T, clang::TypeSourceInfo * TInfo, clang::SourceLocation StartL, clang::IdentifierInfo * Getter, clang::IdentifierInfo * Setter)
  • private void anchor()
  • public static bool classof(const clang::Decl * D)
  • public clang::IdentifierInfo * getGetterId() const
  • public clang::IdentifierInfo * getSetterId() const
  • public bool hasGetter() const
  • public bool hasSetter() const

Inherited from DeclaratorDecl:

Inherited from ValueDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::MSPropertyDecl* Create(
    clang::ASTContext& C,
    clang::DeclContext* DC,
    clang::SourceLocation L,
    clang::DeclarationName N,
    clang::QualType T,
    clang::TypeSourceInfo* TInfo,
    clang::SourceLocation StartL,
    clang::IdentifierInfo* Getter,
    clang::IdentifierInfo* Setter)

Declared at: clang/include/clang/AST/DeclCXX.h:4133

Parameters

clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation L
clang::DeclarationName N
clang::QualType T
clang::TypeSourceInfo* TInfo
clang::SourceLocation StartL
clang::IdentifierInfo* Getter
clang::IdentifierInfo* Setter

static clang::MSPropertyDecl* CreateDeserialized(
    clang::ASTContext& C,
    unsigned int ID)

Declared at: clang/include/clang/AST/DeclCXX.h:4137

Parameters

clang::ASTContext& C
unsigned int ID

MSPropertyDecl(clang::DeclContext* DC,
               clang::SourceLocation L,
               clang::DeclarationName N,
               clang::QualType T,
               clang::TypeSourceInfo* TInfo,
               clang::SourceLocation StartL,
               clang::IdentifierInfo* Getter,
               clang::IdentifierInfo* Setter)

Declared at: clang/include/clang/AST/DeclCXX.h:4123

Parameters

clang::DeclContext* DC
clang::SourceLocation L
clang::DeclarationName N
clang::QualType T
clang::TypeSourceInfo* TInfo
clang::SourceLocation StartL
clang::IdentifierInfo* Getter
clang::IdentifierInfo* Setter

void anchor()

Declared at: clang/include/clang/AST/DeclCXX.h:4129

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

Declared at: clang/include/clang/AST/DeclCXX.h:4139

Parameters

const clang::Decl* D

clang::IdentifierInfo* getGetterId() const

Declared at: clang/include/clang/AST/DeclCXX.h:4142

clang::IdentifierInfo* getSetterId() const

Declared at: clang/include/clang/AST/DeclCXX.h:4144

bool hasGetter() const

Declared at: clang/include/clang/AST/DeclCXX.h:4141

bool hasSetter() const

Declared at: clang/include/clang/AST/DeclCXX.h:4143