diff options
Diffstat (limited to 'src/memberdef.h')
-rw-r--r-- | src/memberdef.h | 422 |
1 files changed, 173 insertions, 249 deletions
diff --git a/src/memberdef.h b/src/memberdef.h index 1d2d9d3..52ee455 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -38,6 +38,7 @@ class OutputList; class GroupDef; class QTextStream; class ArgumentList; +class MemberDefImpl; struct SourceReference { @@ -73,76 +74,79 @@ class MemberDef : public Definition ~MemberDef(); DefType definitionType() const { return TypeMember; } + //----------------------------------------------------------------------------------- + // ---- getters ----- + //----------------------------------------------------------------------------------- + // link id QCString getOutputFileBase() const; QCString getReference() const; QCString anchor() const; - const char *declaration() const { return decl; } - const char *definition() const { return def; } - const char *typeString() const { return type; } - const char *argsString() const { return args; } - const char *excpString() const { return exception; } - const char *bitfieldString() const { return bitfields; } - const QCString &initializer() const { return init; } - int initializerLines() const { return initLines; } - int getMemberSpecifiers() const { return memSpec; } + const char *declaration() const; + const char *definition() const; + const char *typeString() const; + const char *argsString() const; + const char *excpString() const; + const char *bitfieldString() const; + const QCString &initializer() const; + int initializerLines() const; + int getMemberSpecifiers() const; MemberList *getSectionList(Definition *d) const; // scope query members - ClassDef *getClassDef() const { return classDef; } - FileDef *getFileDef() const { return fileDef; } - NamespaceDef* getNamespaceDef() const { return nspace; } - //Definition *getCompoundDef() const; + ClassDef *getClassDef() const; + FileDef *getFileDef() const; + NamespaceDef* getNamespaceDef() const; // grabbing the property read/write accessor names - const char *getReadAccessor() const { return read; } - const char *getWriteAccessor() const { return write; } + const char *getReadAccessor() const; + const char *getWriteAccessor() const; // querying the grouping definition - GroupDef *getGroupDef() const { return group; } - Grouping::GroupPri_t getGroupPri() const { return grouppri; } - const char *getGroupFileName() const { return groupFileName; } - int getGroupStartLine() const { return groupStartLine; } - bool getGroupHasDocs() const { return groupHasDocs; } + GroupDef *getGroupDef() const; + Grouping::GroupPri_t getGroupPri() const; + const char *getGroupFileName() const; + int getGroupStartLine() const; + bool getGroupHasDocs() const; QCString qualifiedName(); QCString objCMethodName(bool localLink,bool showStatic) const; // direct kind info - Protection protection() const { return prot; } + Protection protection() const; Specifier virtualness() const; - MemberType memberType() const { return mtype; } + MemberType memberType() const; QCString memberTypeName() const; // getter methods - bool isSignal() const { return mtype==Signal; } - bool isSlot() const { return mtype==Slot; } - bool isVariable() const { return mtype==Variable; } - bool isEnumerate() const { return mtype==Enumeration; } - bool isEnumValue() const { return mtype==EnumValue; } - bool isTypedef() const { return mtype==Typedef; } - bool isFunction() const { return mtype==Function; } - bool isDefine() const { return mtype==Define; } - bool isFriend() const { return mtype==Friend; } - bool isDCOP() const { return mtype==DCOP; } - bool isProperty() const { return mtype==Property; } - bool isEvent() const { return mtype==Event; } - bool isRelated() const { return related; } - bool isStatic() const { return stat; } - bool isInline() const { return (memSpec&Entry::Inline)!=0; } - bool isExplicit() const { return (memSpec&Entry::Explicit)!=0; } - bool isMutable() const { return (memSpec&Entry::Mutable)!=0; } - bool isGettable() const { return (memSpec&Entry::Gettable)!=0; } - bool isSettable() const { return (memSpec&Entry::Settable)!=0; } - bool isReadable() const { return (memSpec&Entry::Readable)!=0; } - bool isWritable() const { return (memSpec&Entry::Writable)!=0; } - bool isFinal() const { return (memSpec&Entry::Final)!=0; } - bool isAbstract() const { return (memSpec&Entry::Abstract)!=0; } - bool isImplementation() const { return m_implOnly; } - bool isExternal() const { return explExt; } - bool isTemplateSpecialization() const { return tspec; } - bool hasDocumentedParams() const { return m_hasDocumentedParams; } - bool hasDocumentedReturnType() const { return m_hasDocumentedReturnType; } + bool isSignal() const; + bool isSlot() const; + bool isVariable() const; + bool isEnumerate() const; + bool isEnumValue() const; + bool isTypedef() const; + bool isFunction() const; + bool isDefine() const; + bool isFriend() const; + bool isDCOP() const; + bool isProperty() const; + bool isEvent() const; + bool isRelated() const; + bool isStatic() const; + bool isInline() const; + bool isExplicit() const; + bool isMutable() const; + bool isGettable() const; + bool isSettable() const; + bool isReadable() const; + bool isWritable() const; + bool isFinal() const; + bool isAbstract() const; + bool isImplementation() const; + bool isExternal() const; + bool isTemplateSpecialization() const; + bool hasDocumentedParams() const; + bool hasDocumentedReturnType() const; bool isObjCMethod() const; bool isConstructor() const; bool isDestructor() const; @@ -160,153 +164,173 @@ class MemberDef : public Definition bool isFriendClass() const; bool isDocumentedFriendClass() const; + MemberDef *reimplements() const; + LockingPtr<MemberList> reimplementedBy() const; + + int inbodyLine() const; + QCString inbodyFile() const; + const QCString &inbodyDocumentation() const; + + ClassDef *relatedAlso() const; + + bool hasDocumentedEnumValues() const; + MemberDef *getAnonymousEnumType() const; + bool isDocsForDefinition() const; + MemberDef *getEnumScope() const; + LockingPtr<MemberList> enumFieldList() const; + + bool hasExamples(); + LockingPtr<ExampleSDict> getExamples() const; + bool isPrototype() const; + + // argument related members + LockingPtr<ArgumentList> argumentList() const; + LockingPtr<ArgumentList> declArgumentList() const; + LockingPtr<ArgumentList> templateArguments() const; + LockingPtr< QList<ArgumentList> > definitionTemplateParameterLists() const; + + // member group related members + int getMemberGroupId() const; + MemberGroup *getMemberGroup() const; + + bool fromAnonymousScope() const; + bool anonymousDeclShown() const; + + // callgraph related members + bool hasCallGraph() const; + bool hasCallerGraph() const; + bool visibleMemberGroup(bool hideNoHeader); + + MemberDef *templateMaster() const; + QCString getScopeString() const; + ClassDef *getClassDefOfAnonymousType(); + + // cached typedef functions + bool isTypedefValCached() const; + ClassDef *getCachedTypedefVal() const; + QCString getCachedTypedefTemplSpec() const; + + MemberDef *memberDefinition() const; + MemberDef *memberDeclaration() const; + MemberDef *inheritsDocsFrom() const; + MemberDef *getGroupAlias() const; + + //----------------------------------------------------------------------------------- + // ---- setters ----- + //----------------------------------------------------------------------------------- + // set functions - void setMemberType(MemberType t) { mtype=t; } - void setDefinition(const char *d) { def=d; } - void setFileDef(FileDef *fd) { fileDef=fd; } + void setMemberType(MemberType t); + void setDefinition(const char *d); + void setFileDef(FileDef *fd); void setAnchor(const char *a); - void setProtection(Protection p) { prot=p; } - void setMemberSpecifiers(int s) { memSpec=s; } - void mergeMemberSpecifiers(int s) { memSpec|=s; } + void setProtection(Protection p); + void setMemberSpecifiers(int s); + void mergeMemberSpecifiers(int s); void setInitializer(const char *i); - void setBitfields(const char *s) { bitfields = s; } - void setMaxInitLines(int lines) { userInitLines=lines; } + void setBitfields(const char *s); + void setMaxInitLines(int lines); void setMemberClass(ClassDef *cd); void setSectionList(Definition *d,MemberList *sl); void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, const QCString &fileName,int startLine,bool hasDocs, MemberDef *member=0); - void setExplicitExternal(bool b) { explExt=b; } - void setReadAccessor(const char *r) { read=r; } - void setWriteAccessor(const char *w) { write=w; } - void setTemplateSpecialization(bool b) { tspec=b; } + void setExplicitExternal(bool b); + void setReadAccessor(const char *r); + void setWriteAccessor(const char *w); + void setTemplateSpecialization(bool b); - void makeRelated() { related=TRUE; } - void setHasDocumentedParams(bool b) { m_hasDocumentedParams = b; } - void setHasDocumentedReturnType(bool b) { m_hasDocumentedReturnType = b; } - void setInheritsDocsFrom(MemberDef *md) { m_docProvider = md; } + void makeRelated(); + void setHasDocumentedParams(bool b); + void setHasDocumentedReturnType(bool b); + void setInheritsDocsFrom(MemberDef *md); void setTagInfo(TagInfo *i); - void setArgsString(const char *as) { args = as; } + void setArgsString(const char *as); - // output generation - void writeDeclaration(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool inGroup); - void writeDocumentation(MemberList *ml,OutputList &ol, - const char *scopeName,Definition *container, - bool inGroup,bool showEnumValues=FALSE); - void warnIfUndocumented(); - // relation to other members void setReimplements(MemberDef *md); void insertReimplementedBy(MemberDef *md); - MemberDef *reimplements() const; - MemberList *reimplementedBy() const; - + // in-body documentation void setInbodyDocumentation(const char *docs,const char *file,int line); - int inbodyLine() const { return m_inbodyLine; } - QCString inbodyFile() const { return m_inbodyFile; } - const QCString &inbodyDocumentation() const { return m_inbodyDocs; } - - // For function documentation that can also be found in a class's related func section. - void setRelatedAlso(ClassDef *cd) { m_relatedAlso=cd; } - ClassDef *relatedAlso() const { return m_relatedAlso; } - + + void setRelatedAlso(ClassDef *cd); + // enumeration specific members void insertEnumField(MemberDef *md); void setEnumScope(MemberDef *md); - void setEnumClassScope(ClassDef *cd) { classDef = cd; } - MemberDef *getEnumScope() const { return enumScope; } - MemberList *enumFieldList() const { return enumFields; } - void setDocumentedEnumValues(bool value) { docEnumValues=value; } - bool hasDocumentedEnumValues() const { return docEnumValues; } - void setAnonymousEnumType(MemberDef *md) { annEnumType = md; } - MemberDef *getAnonymousEnumType() const { return annEnumType; } - bool isDocsForDefinition() const { return docsForDefinition; } - + void setEnumClassScope(ClassDef *cd); + void setDocumentedEnumValues(bool value); + void setAnonymousEnumType(MemberDef *md); + // example related members bool addExample(const char *anchor,const char *name,const char *file); - bool hasExamples(); - ExampleSDict *getExamples() const { return exampleSDict; } // prototype related members - void setPrototype(bool p) { proto=p; } - bool isPrototype() const { return proto; } - + void setPrototype(bool p); + // argument related members - ArgumentList *argumentList() const { return defArgList; } - ArgumentList *declArgumentList() const { return declArgList; } void setArgumentList(ArgumentList *al); void setDeclArgumentList(ArgumentList *al); - ArgumentList *templateArguments() const { return tArgList; } void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists); - QList<ArgumentList> *definitionTemplateParameterLists() const - { return m_defTmpArgLists; } - + // namespace related members void setNamespace(NamespaceDef *nd); // member group related members void setMemberGroup(MemberGroup *grp); - MemberGroup *getMemberGroup() const { return memberGroup; } - void setMemberGroupId(int id) { grpId=id; } - int getMemberGroupId() const { return grpId; } - void makeImplementationDetail() { m_implOnly=TRUE; } - + void setMemberGroupId(int id); + void makeImplementationDetail(); + // anonymous scope members - void setFromAnonymousScope(bool b) { annScope=b; } - void setFromAnonymousMember(MemberDef *m) { annMemb=m; } - bool fromAnonymousScope() const { return annScope; } - bool anonymousDeclShown() const { return annUsed; } + void setFromAnonymousScope(bool b); + void setFromAnonymousMember(MemberDef *m); - // callgraph related members - bool hasCallGraph() const { return m_hasCallGraph; } void enableCallGraph(bool e); - - // callergraph related members - bool hasCallerGraph() const { return m_hasCallerGraph; } void enableCallerGraph(bool e); - - bool visibleMemberGroup(bool hideNoHeader); - MemberDef *templateMaster() const { return m_templateMaster; } - QCString getScopeString() const; - - ClassDef *getClassDefOfAnonymousType(); - MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs, - ArgumentList *actualArgs); - void setTemplateMaster(MemberDef *mt) { m_templateMaster=mt; } + void setTemplateMaster(MemberDef *mt); void addListReference(Definition *d); + void setDocsForDefinition(bool b); + void setGroupAlias(MemberDef *md); - MemberDef *inheritsDocsFrom() const { return m_docProvider; } - - void setDocsForDefinition(bool b) { docsForDefinition = b; } - void setGroupAlias(MemberDef *md) { groupAlias = md; } - MemberDef *getGroupAlias() const { return groupAlias; } - - // cached typedef functions - bool isTypedefValCached() const { return m_isTypedefValCached; } - ClassDef *getCachedTypedefVal() const { return m_cachedTypedefValue; } - QCString getCachedTypedefTemplSpec() const { return m_cachedTypedefTemplSpec; } - void cacheTypedefVal(ClassDef *val,const QCString &templSpec) - { m_isTypedefValCached=TRUE; m_cachedTypedefValue=val; m_cachedTypedefTemplSpec=templSpec; } - void invalidateTypedefValCache() { m_isTypedefValCached=FALSE; } + void cacheTypedefVal(ClassDef *val,const QCString &templSpec); + void invalidateTypedefValCache(); // declaration <-> definition relation - void setMemberDefinition(MemberDef *md) { memDef=md; } - void setMemberDeclaration(MemberDef *md) { memDec=md; } - MemberDef *memberDefinition() const { return memDef; } - MemberDef *memberDeclaration() const { return memDec; } + void setMemberDefinition(MemberDef *md); + void setMemberDeclaration(MemberDef *md); + void setAnonymousUsed(); + + //----------------------------------------------------------------------------------- + // --- actions ---- + //----------------------------------------------------------------------------------- + + // output generation + void writeDeclaration(OutputList &ol, + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + bool inGroup); + void writeDocumentation(MemberList *ml,OutputList &ol, + const char *scopeName,Definition *container, + bool inGroup,bool showEnumValues=FALSE); + void warnIfUndocumented(); + + MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs, + ArgumentList *actualArgs); + void writeEnumDeclaration(OutputList &typeDecl, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); void findSectionsInDocumentation(); bool visited; - + + protected: + void flushToDisk() const; + void loadFromDisk() const; private: + static int s_indentLevel; // disable copying of member defs MemberDef(const MemberDef &); MemberDef &operator=(const MemberDef &); @@ -315,107 +339,7 @@ class MemberDef : public Definition ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, bool onlyText=FALSE); - ClassDef *classDef; // member of or related to - FileDef *fileDef; // member of file definition - NamespaceDef *nspace; // the namespace this member is in. - - MemberDef *enumScope; // the enclosing scope, if this is an enum field - MemberDef *annEnumType; // the annonymous enum that is the type of this member - MemberList *enumFields; // enumeration fields - OutputList *enumDeclList; // stored piece of documentation for enumeration. - - MemberDef *redefines; // the members that this member redefines - MemberList *redefinedBy; // the list of members that redefine this one - - MemberDef *memDef; // member definition for this declaration - MemberDef *memDec; // member declaration for this definition - ClassDef *m_relatedAlso; // points to class marked by relatedAlso - - ExampleSDict *exampleSDict; // a dictionary of all examples for quick access - - QCString type; // return type - QCString args; // function arguments/variable array specifiers - QCString def; // member definition in code (fully qualified name) - QCString anc; // HTML anchor name - Specifier virt; // normal/virtual/pure virtual - Protection prot; // protection type [Public/Protected/Private] - QCString decl; // member declaration in class: TODO: can be generated - - QCString bitfields; // struct member bitfields - QCString read; // property read accessor - QCString write; // property write accessor - QCString exception; // exceptions that can be thrown - QCString init; // initializer - int initLines; // number of lines in the initializer - - int memSpec; // The specifiers present for this member - MemberType mtype; // returns the kind of member - int maxInitLines; // when the initializer will be displayed - int userInitLines; // result of explicit \hideinitializer or \showinitializer - MemberList *section; // declation list containing this member - MemberDef *annMemb; - - ArgumentList *defArgList; // argument list of this member definition - ArgumentList *declArgList; // argument list of this member declaration - - ArgumentList *tArgList; // template argument list of function template - MemberDef *m_templateMaster; - QList<ArgumentList> *m_defTmpArgLists; - - ClassDef *cachedAnonymousType; // if the member has an anonymous compound - // as its type then this is computed by - // getClassDefOfAnonymousType() and - // cached here. - SDict<MemberList> *classSectionSDict; - - MemberDef *groupAlias; // Member containing the definition - int grpId; // group id - MemberGroup *memberGroup; // group's member definition - GroupDef *group; // group in which this member is in - Grouping::GroupPri_t grouppri; // priority of this definition - QCString groupFileName; // file where this grouping was defined - int groupStartLine; // line " " " " " - MemberDef *groupMember; - - bool m_isTypedefValCached; - ClassDef *m_cachedTypedefValue; - QCString m_cachedTypedefTemplSpec; - - // inbody documentation - int m_inbodyLine; - QCString m_inbodyFile; - QCString m_inbodyDocs; - - // documentation inheritance - MemberDef *m_docProvider; - - // to store the output file base from tag files - QCString explicitOutputFileBase; - - // objective-c - bool m_implOnly; // function found in implementation but not - // in the interface - bool m_hasDocumentedParams; - bool m_hasDocumentedReturnType; - bool m_isDMember; - bool related; // is this a member that is only related to a class - bool stat; // is it a static function? - bool proto; // is it a prototype; - bool docEnumValues; // is an enum with documented enum values. - bool annScope; // member is part of an annoymous scope - bool annUsed; - bool annShown; - bool m_hasCallGraph; - bool m_hasCallerGraph; - bool explExt; // member was explicitly declared external - bool tspec; // member is a template specialization - bool groupHasDocs; // true if the entry that caused the grouping was documented - bool docsForDefinition; // TRUE => documentation block is put before - // definition. - // FALSE => block is put before declaration. - - static int s_indentLevel; - + MemberDefImpl *m_impl; }; #endif |