class ObjCCategoryDecl
Declaration
class ObjCCategoryDecl : public ObjCContainerDecl { /* full declaration omitted */ };
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) - myMethod; @ end 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.
Declared at: clang/include/clang/AST/DeclObjC.h:2276
Inherits from: ObjCContainerDecl
Member Variables
- private clang::ObjCInterfaceDecl* ClassInterface
- Interface belonging to this category
- private clang::ObjCTypeParamList* TypeParamList = nullptr
- The type parameters associated with this category, if any.
- private clang::ObjCProtocolList ReferencedProtocols
- referenced protocols in this category.
- private clang::ObjCCategoryDecl* NextClassCategory = nullptr
- Next category belonging to this class. FIXME: this should not be a singly-linked list. Move storage elsewhere.
- private clang::SourceLocation CategoryNameLoc
- The location of the category name in this declaration.
- private clang::SourceLocation IvarLBraceLoc
- class extension may have private ivars.
- private clang::SourceLocation IvarRBraceLoc
Inherited from DeclContext:
- protected
- protected FirstDecl = nullptr
- protected LastDecl = nullptr
Inherited from Decl:
- protected NextInContextAndBits
- protected Access
- protected FromASTFile
- protected IdentifierNamespace
- protected CacheValidAndLinkage
Method Overview
- public static clang::ObjCCategoryDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation AtLoc, clang::SourceLocation ClassNameLoc, clang::SourceLocation CategoryNameLoc, clang::IdentifierInfo * Id, clang::ObjCInterfaceDecl * IDecl, clang::ObjCTypeParamList * typeParamList, clang::SourceLocation IvarLBraceLoc = clang::SourceLocation(), clang::SourceLocation IvarRBraceLoc = clang::SourceLocation())
- public static clang::ObjCCategoryDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
- public bool IsClassExtension() const
- private ObjCCategoryDecl(clang::DeclContext * DC, clang::SourceLocation AtLoc, clang::SourceLocation ClassNameLoc, clang::SourceLocation CategoryNameLoc, clang::IdentifierInfo * Id, clang::ObjCInterfaceDecl * IDecl, clang::ObjCTypeParamList * typeParamList, clang::SourceLocation IvarLBraceLoc = clang::SourceLocation(), clang::SourceLocation IvarRBraceLoc = clang::SourceLocation())
- private void anchor()
- public static bool classof(const clang::Decl * D)
- public static bool classofKind(clang::Decl::Kind K)
- public clang::SourceLocation getCategoryNameLoc() const
- public clang::ObjCInterfaceDecl * getClassInterface()
- public const clang::ObjCInterfaceDecl * getClassInterface() const
- public clang::ObjCCategoryImplDecl * getImplementation() const
- public clang::SourceLocation getIvarLBraceLoc() const
- public clang::SourceLocation getIvarRBraceLoc() const
- public clang::ObjCCategoryDecl * getNextClassCategory() const
- public clang::ObjCCategoryDecl * getNextClassCategoryRaw() const
- public const clang::ObjCProtocolList & getReferencedProtocols() const
- public clang::ObjCTypeParamList * getTypeParamList() const
- public clang::ObjCCategoryDecl::ivar_iterator ivar_begin() const
- public bool ivar_empty() const
- public clang::ObjCCategoryDecl::ivar_iterator ivar_end() const
- public unsigned int ivar_size() const
- public clang::ObjCCategoryDecl::ivar_range ivars() const
- public clang::ObjCCategoryDecl::protocol_iterator protocol_begin() const
- public clang::ObjCCategoryDecl::protocol_iterator protocol_end() const
- public clang::ObjCCategoryDecl::protocol_loc_iterator protocol_loc_begin() const
- public clang::ObjCCategoryDecl::protocol_loc_iterator protocol_loc_end() const
- public clang::ObjCCategoryDecl::protocol_loc_range protocol_locs() const
- public unsigned int protocol_size() const
- public clang::ObjCCategoryDecl::protocol_range protocols() const
- public void setCategoryNameLoc(clang::SourceLocation Loc)
- public void setImplementation(clang::ObjCCategoryImplDecl * ImplD)
- public void setIvarLBraceLoc(clang::SourceLocation Loc)
- public void setIvarRBraceLoc(clang::SourceLocation Loc)
- public void setProtocolList(clang::ObjCProtocolDecl *const * List, unsigned int Num, const clang::SourceLocation * Locs, clang::ASTContext & C)
- public void setTypeParamList(clang::ObjCTypeParamList * TPL)
Inherited from ObjCContainerDecl:
- public FindPropertyDeclaration
- public HasUserDeclaredSetterMethod
- public castFromDeclContext
- public castToDeclContext
- public class_methods
- public class_properties
- public classmeth_begin
- public classmeth_end
- public classof
- public classofKind
- public classprop_begin
- public classprop_end
- public collectPropertiesToImplement
- public getAtEndRange
- public getAtStartLoc
- public getClassMethod
- public getInstanceMethod
- public getIvarDecl
- public getMethod
- public getProperty
- public getSourceRange
- public instance_methods
- public instance_properties
- public instmeth_begin
- public instmeth_end
- public instprop_begin
- public instprop_end
- public meth_begin
- public meth_end
- public methods
- public prop_begin
- public prop_end
- public properties
- public setAtEndRange
- public setAtStartLoc
Inherited from DeclContext:
- protected BuildDeclChain
- public Encloses
- public Equals
- public InEnclosingNamespaceSetOf
- public addDecl
- public addDeclInternal
- public addHiddenDecl
- public buildLookup
- public classof
- public classof
- public collectAllContexts
- public containsDecl
- public containsDeclAndLoad
- public ddiags
- public decls
- public decls_begin
- public decls_empty
- public decls_end
- public dumpDeclContext
- public dumpLookups
- public dumpLookups
- public getDeclKind
- public getDeclKindName
- public getEnclosingNamespaceContext
- public getEnclosingNamespaceContext
- public getExternCContext
- public getInnermostBlockDecl
- public getLexicalParent
- public getLexicalParent
- public getLookupParent
- public getLookupParent
- public getLookupPtr
- public getNonClosureAncestor
- public getNonClosureAncestor
- public getNonTransparentContext
- public getNonTransparentContext
- public getOuterLexicalRecordContext
- public getOuterLexicalRecordContext
- public getParent
- public getParent
- public getParentASTContext
- public getPrimaryContext
- public getPrimaryContext
- public getRedeclContext
- public getRedeclContext
- public hasExternalLexicalStorage
- public hasExternalVisibleStorage
- public isClosure
- public isDeclInLexicalTraversal
- public isDependentContext
- public isExternCContext
- public isExternCXXContext
- public isFileContext
- public isFunctionOrMethod
- public isInlineNamespace
- public isLookupContext
- public isNamespace
- public isObjCContainer
- public isRecord
- public isStdNamespace
- public isTranslationUnit
- public isTransparentContext
- public localUncachedLookup
- public lookup
- public lookups
- public lookups_begin
- public lookups_end
- public makeDeclVisibleInContext
- public noload_decls
- public noload_decls_begin
- public noload_decls_end
- public noload_lookup
- public noload_lookups
- public noload_lookups_begin
- public noload_lookups_end
- public removeDecl
- public setHasExternalLexicalStorage
- public setHasExternalVisibleStorage
- public setMustBuildLookupTable
- public setUseQualifiedLookup
- public shouldUseQualifiedLookup
- public using_directives
Inherited from NamedDecl:
- public classof
- public classofKind
- public declarationReplaces
- public getDeclName
- public getExplicitVisibility
- public getFormalLinkage
- public getIdentifier
- public getLinkageAndVisibility
- public getLinkageInternal
- public getMostRecentDecl
- public getMostRecentDecl
- public getName
- public getNameAsString
- public getNameForDiagnostic
- public getObjCFStringFormattingFamily
- public getQualifiedNameAsString
- public getUnderlyingDecl
- public getUnderlyingDecl
- public getVisibility
- public hasExternalFormalLinkage
- public hasLinkage
- public hasLinkageBeenComputed
- public isCXXClassMember
- public isCXXInstanceMember
- public isExternallyDeclarable
- public isExternallyVisible
- public isLinkageValid
- public isReserved
- public printName
- public printNestedNameSpecifier
- public printNestedNameSpecifier
- public printQualifiedName
- public printQualifiedName
- public setDeclName
Inherited from Decl:
- public EnableStatistics
- public PrintStats
- public add
- public addAttr
- public attr_begin
- public attr_end
- public attrs
- public canBeWeakImported
- public castFromDeclContext
- public castToDeclContext
- public classofKind
- public dropAttr
- public dropAttrs
- public dump
- public dump
- public dumpColor
- public getASTContext
- protected getASTMutationListener
- public getAccess
- public getAccessUnsafe
- public getAsFunction
- public getAsFunction
- public getAttr
- public getAttrs
- public getAttrs
- public getAvailability
- public getBeginLoc
- public getBody
- public getBodyRBrace
- protected getCachedLinkage
- public getCanonicalDecl
- public getCanonicalDecl
- public getDeclContext
- public getDeclContext
- public getDeclKindName
- public getDefiningAttr
- public getDescribedTemplate
- public getDescribedTemplateParams
- public getEndLoc
- public getExternalSourceSymbolAttr
- public getFriendObjectKind
- public getFunctionType
- public getGlobalID
- public getID
- public getIdentifierNamespace
- public getIdentifierNamespaceForKind
- public getImportedOwningModule
- public getKind
- public getLangOpts
- public getLexicalDeclContext
- public getLexicalDeclContext
- public getLocalOwningModule
- public getLocation
- public getMaxAlignment
- public getModuleOwnershipKind
- public getMostRecentDecl
- public getMostRecentDecl
- protected getMostRecentDeclImpl
- public getNextDeclInContext
- public getNextDeclInContext
- protected getNextRedeclarationImpl
- public getNonClosureContext
- public getNonClosureContext
- public getOwningModule
- public getOwningModuleForLinkage
- public getOwningModuleID
- public getParentFunctionOrMethod
- public getParentFunctionOrMethod
- public getPreviousDecl
- public getPreviousDecl
- protected getPreviousDeclImpl
- public getSourceRange
- public getTemplateDepth
- public getTranslationUnitDecl
- public getTranslationUnitDecl
- public getVersionIntroduced
- public hasAttr
- public hasAttrs
- public hasBody
- protected hasCachedLinkage
- public hasDefiningAttr
- protected hasLocalOwningModuleStorage
- public hasOwningModule
- public hasTagIdentifierNamespace
- public isCanonicalDecl
- public isDefinedOutsideFunctionOrMethod
- public isDeprecated
- public isDiscardedInGlobalModuleFragment
- public isFirstDecl
- public isFromASTFile
- public isFunctionOrFunctionTemplate
- public isImplicit
- public isInAnonymousNamespace
- public isInExportDeclContext
- public isInIdentifierNamespace
- public isInLocalScopeForInstantiation
- public isInStdNamespace
- public isInvalidDecl
- public isInvisibleOutsideTheOwningModule
- public isLocalExternDecl
- public isModulePrivate
- public isOutOfLine
- public isParameterPack
- public isReachable
- public isReferenced
- public isTagIdentifierNamespace
- public isTemplateDecl
- public isTemplateParameter
- public isTemplateParameterPack
- public isTemplated
- public isThisDeclarationReferenced
- public isTopLevelDeclInObjCContainer
- public isUnavailable
- public isUnconditionallyVisible
- public isUsed
- public isWeakImported
- public markUsed
- public print
- public print
- public printGroup
- public redecls
- public redecls_begin
- public redecls_end
- public setAccess
- public setAttrs
- protected setCachedLinkage
- public setDeclContext
- public setFromASTFile
- public setImplicit
- public setInvalidDecl
- public setIsUsed
- public setLexicalDeclContext
- public setLocalExternDecl
- public setLocalOwningModule
- public setLocation
- public setModuleOwnershipKind
- protected setModulePrivate
- public setNonMemberOperator
- public setObjectOfFriendDecl
- public setOwningModuleID
- public setReferenced
- public setTopLevelDeclInObjCContainer
- public setVisibleDespiteOwningModule
- public specific_attr_begin
- public specific_attr_end
- public specific_attrs
- protected updateOutOfDate
Methods
¶static clang::ObjCCategoryDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation AtLoc,
clang::SourceLocation ClassNameLoc,
clang::SourceLocation CategoryNameLoc,
clang::IdentifierInfo* Id,
clang::ObjCInterfaceDecl* IDecl,
clang::ObjCTypeParamList* typeParamList,
clang::SourceLocation IvarLBraceLoc =
clang::SourceLocation(),
clang::SourceLocation IvarRBraceLoc =
clang::SourceLocation())
static clang::ObjCCategoryDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation AtLoc,
clang::SourceLocation ClassNameLoc,
clang::SourceLocation CategoryNameLoc,
clang::IdentifierInfo* Id,
clang::ObjCInterfaceDecl* IDecl,
clang::ObjCTypeParamList* typeParamList,
clang::SourceLocation IvarLBraceLoc =
clang::SourceLocation(),
clang::SourceLocation IvarRBraceLoc =
clang::SourceLocation())
Declared at: clang/include/clang/AST/DeclObjC.h:2310
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::SourceLocation AtLoc
- clang::SourceLocation ClassNameLoc
- clang::SourceLocation CategoryNameLoc
- clang::IdentifierInfo* Id
- clang::ObjCInterfaceDecl* IDecl
- clang::ObjCTypeParamList* typeParamList
- clang::SourceLocation IvarLBraceLoc = clang::SourceLocation()
- clang::SourceLocation IvarRBraceLoc = clang::SourceLocation()
¶static clang::ObjCCategoryDecl*
CreateDeserialized(clang::ASTContext& C,
unsigned int ID)
static clang::ObjCCategoryDecl*
CreateDeserialized(clang::ASTContext& C,
unsigned int ID)
Declared at: clang/include/clang/AST/DeclObjC.h:2319
Parameters
- clang::ASTContext& C
- unsigned int ID
¶bool IsClassExtension() const
bool IsClassExtension() const
Declared at: clang/include/clang/AST/DeclObjC.h:2386
¶ObjCCategoryDecl(
clang::DeclContext* DC,
clang::SourceLocation AtLoc,
clang::SourceLocation ClassNameLoc,
clang::SourceLocation CategoryNameLoc,
clang::IdentifierInfo* Id,
clang::ObjCInterfaceDecl* IDecl,
clang::ObjCTypeParamList* typeParamList,
clang::SourceLocation IvarLBraceLoc =
clang::SourceLocation(),
clang::SourceLocation IvarRBraceLoc =
clang::SourceLocation())
ObjCCategoryDecl(
clang::DeclContext* DC,
clang::SourceLocation AtLoc,
clang::SourceLocation ClassNameLoc,
clang::SourceLocation CategoryNameLoc,
clang::IdentifierInfo* Id,
clang::ObjCInterfaceDecl* IDecl,
clang::ObjCTypeParamList* typeParamList,
clang::SourceLocation IvarLBraceLoc =
clang::SourceLocation(),
clang::SourceLocation IvarRBraceLoc =
clang::SourceLocation())
Declared at: clang/include/clang/AST/DeclObjC.h:2297
Parameters
- clang::DeclContext* DC
- clang::SourceLocation AtLoc
- clang::SourceLocation ClassNameLoc
- clang::SourceLocation CategoryNameLoc
- clang::IdentifierInfo* Id
- clang::ObjCInterfaceDecl* IDecl
- clang::ObjCTypeParamList* typeParamList
- clang::SourceLocation IvarLBraceLoc = clang::SourceLocation()
- clang::SourceLocation IvarRBraceLoc = clang::SourceLocation()
¶void anchor()
void anchor()
Declared at: clang/include/clang/AST/DeclObjC.h:2304
¶static bool classof(const clang::Decl* D)
static bool classof(const clang::Decl* D)
Declared at: clang/include/clang/AST/DeclObjC.h:2417
Parameters
- const clang::Decl* D
¶static bool classofKind(clang::Decl::Kind K)
static bool classofKind(clang::Decl::Kind K)
Declared at: clang/include/clang/AST/DeclObjC.h:2418
Parameters
- clang::Decl::Kind K
¶clang::SourceLocation getCategoryNameLoc() const
clang::SourceLocation getCategoryNameLoc() const
Declared at: clang/include/clang/AST/DeclObjC.h:2409
¶clang::ObjCInterfaceDecl* getClassInterface()
clang::ObjCInterfaceDecl* getClassInterface()
Declared at: clang/include/clang/AST/DeclObjC.h:2321
¶const clang::ObjCInterfaceDecl*
getClassInterface() const
const clang::ObjCInterfaceDecl*
getClassInterface() const
Declared at: clang/include/clang/AST/DeclObjC.h:2322
¶clang::ObjCCategoryImplDecl* getImplementation()
const
clang::ObjCCategoryImplDecl* getImplementation()
const
Declared at: clang/include/clang/AST/DeclObjC.h:2335
¶clang::SourceLocation getIvarLBraceLoc() const
clang::SourceLocation getIvarLBraceLoc() const
Declared at: clang/include/clang/AST/DeclObjC.h:2413
¶clang::SourceLocation getIvarRBraceLoc() const
clang::SourceLocation getIvarRBraceLoc() const
Declared at: clang/include/clang/AST/DeclObjC.h:2415
¶clang::ObjCCategoryDecl* getNextClassCategory()
const
clang::ObjCCategoryDecl* getNextClassCategory()
const
Declared at: clang/include/clang/AST/DeclObjC.h:2378
¶clang::ObjCCategoryDecl* getNextClassCategoryRaw()
const
clang::ObjCCategoryDecl* getNextClassCategoryRaw()
const
Description
Retrieve the pointer to the next stored category (or extension), which may be hidden.
Declared at: clang/include/clang/AST/DeclObjC.h:2382
¶const clang::ObjCProtocolList&
getReferencedProtocols() const
const clang::ObjCProtocolList&
getReferencedProtocols() const
Declared at: clang/include/clang/AST/DeclObjC.h:2345
¶clang::ObjCTypeParamList* getTypeParamList() const
clang::ObjCTypeParamList* getTypeParamList() const
Description
Retrieve the type parameter list associated with this category or extension.
Declared at: clang/include/clang/AST/DeclObjC.h:2326
¶clang::ObjCCategoryDecl::ivar_iterator
ivar_begin() const
clang::ObjCCategoryDecl::ivar_iterator
ivar_begin() const
Declared at: clang/include/clang/AST/DeclObjC.h:2393
¶bool ivar_empty() const
bool ivar_empty() const
Declared at: clang/include/clang/AST/DeclObjC.h:2405
¶clang::ObjCCategoryDecl::ivar_iterator ivar_end()
const
clang::ObjCCategoryDecl::ivar_iterator ivar_end()
const
Declared at: clang/include/clang/AST/DeclObjC.h:2397
¶unsigned int ivar_size() const
unsigned int ivar_size() const
Declared at: clang/include/clang/AST/DeclObjC.h:2401
¶clang::ObjCCategoryDecl::ivar_range ivars() const
clang::ObjCCategoryDecl::ivar_range ivars() const
Declared at: clang/include/clang/AST/DeclObjC.h:2391
¶clang::ObjCCategoryDecl::protocol_iterator
protocol_begin() const
clang::ObjCCategoryDecl::protocol_iterator
protocol_begin() const
Declared at: clang/include/clang/AST/DeclObjC.h:2356
¶clang::ObjCCategoryDecl::protocol_iterator
protocol_end() const
clang::ObjCCategoryDecl::protocol_iterator
protocol_end() const
Declared at: clang/include/clang/AST/DeclObjC.h:2360
¶clang::ObjCCategoryDecl::protocol_loc_iterator
protocol_loc_begin() const
clang::ObjCCategoryDecl::protocol_loc_iterator
protocol_loc_begin() const
Declared at: clang/include/clang/AST/DeclObjC.h:2370
¶clang::ObjCCategoryDecl::protocol_loc_iterator
protocol_loc_end() const
clang::ObjCCategoryDecl::protocol_loc_iterator
protocol_loc_end() const
Declared at: clang/include/clang/AST/DeclObjC.h:2374
¶clang::ObjCCategoryDecl::protocol_loc_range
protocol_locs() const
clang::ObjCCategoryDecl::protocol_loc_range
protocol_locs() const
Declared at: clang/include/clang/AST/DeclObjC.h:2366
¶unsigned int protocol_size() const
unsigned int protocol_size() const
Declared at: clang/include/clang/AST/DeclObjC.h:2361
¶clang::ObjCCategoryDecl::protocol_range
protocols() const
clang::ObjCCategoryDecl::protocol_range
protocols() const
Declared at: clang/include/clang/AST/DeclObjC.h:2352
¶void setCategoryNameLoc(clang::SourceLocation Loc)
void setCategoryNameLoc(clang::SourceLocation Loc)
Declared at: clang/include/clang/AST/DeclObjC.h:2410
Parameters
¶void setImplementation(
clang::ObjCCategoryImplDecl* ImplD)
void setImplementation(
clang::ObjCCategoryImplDecl* ImplD)
Declared at: clang/include/clang/AST/DeclObjC.h:2336
Parameters
- clang::ObjCCategoryImplDecl* ImplD
¶void setIvarLBraceLoc(clang::SourceLocation Loc)
void setIvarLBraceLoc(clang::SourceLocation Loc)
Declared at: clang/include/clang/AST/DeclObjC.h:2412
Parameters
¶void setIvarRBraceLoc(clang::SourceLocation Loc)
void setIvarRBraceLoc(clang::SourceLocation Loc)
Declared at: clang/include/clang/AST/DeclObjC.h:2414
Parameters
¶void setProtocolList(
clang::ObjCProtocolDecl* const* List,
unsigned int Num,
const clang::SourceLocation* Locs,
clang::ASTContext& C)
void setProtocolList(
clang::ObjCProtocolDecl* const* List,
unsigned int Num,
const clang::SourceLocation* Locs,
clang::ASTContext& C)
Description
setProtocolList - Set the list of protocols that this interface implements.
Declared at: clang/include/clang/AST/DeclObjC.h:2340
Parameters
- clang::ObjCProtocolDecl* const* List
- unsigned int Num
- const clang::SourceLocation* Locs
- clang::ASTContext& C
¶void setTypeParamList(
clang::ObjCTypeParamList* TPL)
void setTypeParamList(
clang::ObjCTypeParamList* TPL)
Description
Set the type parameters of this category. This function is used by the AST importer, which must import the type parameters after creating their DeclContext to avoid loops.
Declared at: clang/include/clang/AST/DeclObjC.h:2332