clang API Documentation
#include <DeclCXX.h>
Public Member Functions | |
bool | hasGetter () const |
IdentifierInfo * | getGetterId () const |
bool | hasSetter () const |
IdentifierInfo * | getSetterId () const |
Static Public Member Functions | |
static MSPropertyDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL, IdentifierInfo *Getter, IdentifierInfo *Setter) |
static MSPropertyDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
Friends | |
class | ASTDeclReader |
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.
static bool clang::MSPropertyDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::DeclaratorDecl.
Definition at line 3234 of file DeclCXX.h.
References clang::Decl::getKind().
MSPropertyDecl * MSPropertyDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
DeclarationName | N, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo, | ||
SourceLocation | StartL, | ||
IdentifierInfo * | Getter, | ||
IdentifierInfo * | Setter | ||
) | [static] |
Definition at line 2169 of file DeclCXX.cpp.
References AttributeLangSupport::C.
Referenced by clang::Sema::HandleMSProperty().
MSPropertyDecl * MSPropertyDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Definition at line 2178 of file DeclCXX.cpp.
References AttributeLangSupport::C.
IdentifierInfo* clang::MSPropertyDecl::getGetterId | ( | ) | const [inline] |
Definition at line 3237 of file DeclCXX.h.
Referenced by clang::ASTDeclWriter::VisitMSPropertyDecl().
IdentifierInfo* clang::MSPropertyDecl::getSetterId | ( | ) | const [inline] |
Definition at line 3239 of file DeclCXX.h.
Referenced by clang::ASTDeclWriter::VisitMSPropertyDecl().
bool clang::MSPropertyDecl::hasGetter | ( | ) | const [inline] |
bool clang::MSPropertyDecl::hasSetter | ( | ) | const [inline] |
friend class ASTDeclReader [friend] |
Reimplemented from clang::DeclaratorDecl.