clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::ObjCCategoryDecl Class Reference

#include <DeclObjC.h>

Inheritance diagram for clang::ObjCCategoryDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::ObjCCategoryDecl:
Collaboration graph
[legend]

List of all members.

Public Types

typedef ObjCProtocolList::iterator protocol_iterator
typedef llvm::iterator_range
< protocol_iterator
protocol_range
typedef
ObjCProtocolList::loc_iterator 
protocol_loc_iterator
typedef llvm::iterator_range
< protocol_loc_iterator
protocol_loc_range
typedef specific_decl_iterator
< ObjCIvarDecl
ivar_iterator
typedef llvm::iterator_range
< specific_decl_iterator
< ObjCIvarDecl > > 
ivar_range

Public Member Functions

ObjCInterfaceDeclgetClassInterface ()
const ObjCInterfaceDeclgetClassInterface () const
ObjCCategoryImplDeclgetImplementation () const
void setImplementation (ObjCCategoryImplDecl *ImplD)
void setProtocolList (ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
const ObjCProtocolListgetReferencedProtocols () const
protocol_range protocols () const
protocol_iterator protocol_begin () const
protocol_iterator protocol_end () const
unsigned protocol_size () const
protocol_loc_range protocol_locs () const
protocol_loc_iterator protocol_loc_begin () const
protocol_loc_iterator protocol_loc_end () const
ObjCCategoryDeclgetNextClassCategory () const
ObjCCategoryDeclgetNextClassCategoryRaw () const
 Retrieve the pointer to the next stored category (or extension), which may be hidden.
bool IsClassExtension () const
ivar_range ivars () const
ivar_iterator ivar_begin () const
ivar_iterator ivar_end () const
unsigned ivar_size () const
bool ivar_empty () const
SourceLocation getCategoryNameLoc () const
void setCategoryNameLoc (SourceLocation Loc)
void setIvarLBraceLoc (SourceLocation Loc)
SourceLocation getIvarLBraceLoc () const
void setIvarRBraceLoc (SourceLocation Loc)
SourceLocation getIvarRBraceLoc () const

Static Public Member Functions

static ObjCCategoryDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
static ObjCCategoryDeclCreateDeserialized (ASTContext &C, unsigned ID)
static bool classof (const Decl *D)
static bool classofKind (Kind K)

Friends

class ASTDeclReader
class ASTDeclWriter

Detailed Description

ObjCCategoryDecl - Represents a category declaration. A category allows you to add methods to an existing class (without subclassing or modifying the original class interface or implementation:-). Categories don't allow you to add instance data. The following example adds "myMethod" to all NSView's within a process:

@interface NSView (MyViewMethods)

Categories also allow you to split the implementation of a class across several files (a feature more naturally supported in C++).

Categories were originally inspired by dynamic languages such as Common Lisp and Smalltalk. More traditional class-based languages (C++, Java) don't support this level of dynamism, which is both powerful and dangerous.

Definition at line 1715 of file DeclObjC.h.


Member Typedef Documentation

Definition at line 1809 of file DeclObjC.h.

Definition at line 1810 of file DeclObjC.h.

Definition at line 1775 of file DeclObjC.h.

Definition at line 1786 of file DeclObjC.h.

Definition at line 1787 of file DeclObjC.h.

Definition at line 1776 of file DeclObjC.h.


Member Function Documentation

static bool clang::ObjCCategoryDecl::classof ( const Decl D) [inline, static]

Reimplemented from clang::ObjCContainerDecl.

Definition at line 1834 of file DeclObjC.h.

References classofKind(), and clang::Decl::getKind().

static bool clang::ObjCCategoryDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::ObjCContainerDecl.

Definition at line 1835 of file DeclObjC.h.

Referenced by classof().

ObjCCategoryDecl * ObjCCategoryDecl::Create ( ASTContext C,
DeclContext DC,
SourceLocation  AtLoc,
SourceLocation  ClassNameLoc,
SourceLocation  CategoryNameLoc,
IdentifierInfo Id,
ObjCInterfaceDecl IDecl,
SourceLocation  IvarLBraceLoc = SourceLocation(),
SourceLocation  IvarRBraceLoc = SourceLocation() 
) [static]

Definition at line 1676 of file DeclObjC.cpp.

References AttributeLangSupport::C.

Definition at line 1759 of file DeclObjC.h.

Definition at line 1799 of file DeclObjC.h.

Retrieve the pointer to the next stored category (or extension), which may be hidden.

Definition at line 1803 of file DeclObjC.h.

Definition at line 1771 of file DeclObjC.h.

Definition at line 1813 of file DeclObjC.h.

References clang::DeclContext::decls_begin().

Referenced by ivar_empty(), ivar_size(), and ivars().

Definition at line 1822 of file DeclObjC.h.

References ivar_begin(), and ivar_end().

Definition at line 1816 of file DeclObjC.h.

References clang::DeclContext::decls_end().

Referenced by ivar_empty(), ivar_size(), and ivars().

Definition at line 1819 of file DeclObjC.h.

References ivar_begin(), and ivar_end().

Definition at line 1812 of file DeclObjC.h.

References ivar_begin(), and ivar_end().

Definition at line 1784 of file DeclObjC.h.

References clang::ObjCList< T >::end().

Referenced by protocols(), and clang::ASTNodeImporter::VisitObjCCategoryDecl().

Definition at line 1795 of file DeclObjC.h.

References clang::ObjCProtocolList::loc_end().

Referenced by protocol_locs().

Definition at line 1789 of file DeclObjC.h.

References protocol_loc_begin(), and protocol_loc_end().

Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl().

Definition at line 1785 of file DeclObjC.h.

References clang::ObjCListBase::size().

Referenced by clang::ASTDeclWriter::VisitObjCCategoryDecl().

Definition at line 1827 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCCategoryDecl().

Definition at line 1829 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCCategoryDecl().

Definition at line 1831 of file DeclObjC.h.

Referenced by clang::ASTDeclReader::VisitObjCCategoryDecl().

void clang::ObjCCategoryDecl::setProtocolList ( ObjCProtocolDecl *const *  List,
unsigned  Num,
const SourceLocation Locs,
ASTContext C 
) [inline]

setProtocolList - Set the list of protocols that this interface implements.

Definition at line 1766 of file DeclObjC.h.

References clang::ObjCProtocolList::set().

Referenced by clang::Sema::ActOnStartCategoryInterface(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), and clang::ASTDeclReader::VisitObjCCategoryDecl().


Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Reimplemented from clang::DeclContext.

Definition at line 1837 of file DeclObjC.h.

friend class ASTDeclWriter [friend]

Reimplemented from clang::Decl.

Definition at line 1838 of file DeclObjC.h.


The documentation for this class was generated from the following files: