diff options
Diffstat (limited to 'src/namespacedef.h')
-rw-r--r-- | src/namespacedef.h | 179 |
1 files changed, 68 insertions, 111 deletions
diff --git a/src/namespacedef.h b/src/namespacedef.h index 6f406d8..bfa8c42 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -26,142 +26,99 @@ class MemberList; class ClassDef; -class ClassList; class OutputList; class ClassSDict; class MemberDef; -class NamespaceList; class MemberGroupSDict; class NamespaceSDict; class FTextStream; -/** A model of a namespace symbol. */ -class NamespaceDef : public Definition +/** An abstract interface of a namespace symbol. */ +class NamespaceDef : virtual public Definition { public: - NamespaceDef(const char *defFileName,int defLine,int defColumn, - const char *name,const char *ref=0, - const char *refFile=0,const char*type=0, - bool isPublished=false); - ~NamespaceDef(); - DefType definitionType() const { return TypeNamespace; } - QCString getOutputFileBase() const; - QCString anchor() const { return QCString(); } - void insertUsedFile(FileDef *fd); - - void writeDocumentation(OutputList &ol); - void writeMemberPages(OutputList &ol); - void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; - void writeTagFile(FTextStream &); - - void insertClass(ClassDef *cd); - void insertNamespace(NamespaceDef *nd); - void insertMember(MemberDef *md); - - void computeAnchors(); - int countMembers(); - void addUsingDirective(NamespaceDef *nd); - NamespaceSDict *getUsedNamespaces() const; - void addUsingDeclaration(Definition *def); - SDict<Definition> *getUsedClasses() const { return usingDeclList; } - void combineUsingRelations(); - QCString displayName(bool=TRUE) const; - QCString localName() const; - void setInline(bool isInline) { m_inline = isInline; } - - bool isConstantGroup() const { return CONSTANT_GROUP == m_type; } - bool isModule() const { return MODULE == m_type; } - bool isLibrary() const { return LIBRARY == m_type; } - bool isInline() const { return m_inline; } - - bool isLinkableInProject() const; - bool isLinkable() const; - bool hasDetailedDescription() const; - void addMembersToMemberGroup(); - void distributeMemberGroupDocumentation(); - void findSectionsInDocumentation(); - void sortMemberLists(); - - virtual Definition *findInnerCompound(const char *name) const; - void addInnerCompound(Definition *d); - void addListReferences(); - void setFileName(const QCString &fn); - - bool subGrouping() const { return m_subGrouping; } - - MemberList *getMemberList(MemberListType lt) const; - const QList<MemberList> &getMemberLists() const { return m_memberLists; } - MemberDef *getMemberByName(const QCString &) const; + virtual ~NamespaceDef() {} + virtual DefType definitionType() const = 0; + virtual QCString getOutputFileBase() const = 0; + virtual QCString anchor() const = 0; + virtual void insertUsedFile(FileDef *fd) = 0; + + virtual void writeDocumentation(OutputList &ol) = 0; + virtual void writeMemberPages(OutputList &ol) = 0; + virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const = 0; + virtual void writeTagFile(FTextStream &) = 0; + + virtual void insertClass(ClassDef *cd) = 0; + virtual void insertNamespace(NamespaceDef *nd) = 0; + virtual void insertMember(MemberDef *md) = 0; + + virtual void computeAnchors() = 0; + virtual int countMembers() = 0; + virtual void addUsingDirective(NamespaceDef *nd) = 0; + virtual NamespaceSDict *getUsedNamespaces() const = 0; + virtual void addUsingDeclaration(Definition *def) = 0; + virtual SDict<Definition> *getUsedClasses() const = 0; + virtual void combineUsingRelations() = 0; + virtual QCString displayName(bool=TRUE) const = 0; + virtual QCString localName() const = 0; + virtual void setInline(bool isInline) = 0; + + virtual bool isConstantGroup() const = 0; + virtual bool isModule() const = 0; + virtual bool isLibrary() const = 0; + virtual bool isInline() const = 0; + + virtual bool isLinkableInProject() const = 0; + virtual bool isLinkable() const = 0; + virtual bool hasDetailedDescription() const = 0; + virtual void addMembersToMemberGroup() = 0; + virtual void distributeMemberGroupDocumentation() = 0; + virtual void findSectionsInDocumentation() = 0; + virtual void sortMemberLists() = 0; + + virtual Definition *findInnerCompound(const char *name) const = 0; + virtual void addInnerCompound(Definition *d) = 0; + virtual void addListReferences() = 0; + virtual void setFileName(const QCString &fn) = 0; + + virtual bool subGrouping() const = 0; + + virtual MemberList *getMemberList(MemberListType lt) const = 0; + virtual const QList<MemberList> &getMemberLists() const = 0; + virtual MemberDef *getMemberByName(const QCString &) const = 0; /*! Returns the user defined member groups */ - MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; } + virtual MemberGroupSDict *getMemberGroupSDict() const = 0; /*! Returns the classes contained in this namespace */ - ClassSDict *getClassSDict() const { return classSDict; } + virtual ClassSDict *getClassSDict() const = 0; /*! Returns the Slice interfaces contained in this namespace */ - ClassSDict *getInterfaceSDict() const { return interfaceSDict; } + virtual ClassSDict *getInterfaceSDict() const = 0; /*! Returns the Slice structs contained in this namespace */ - ClassSDict *getStructSDict() const { return structSDict; } + virtual ClassSDict *getStructSDict() const = 0; /*! Returns the Slice exceptions contained in this namespace */ - ClassSDict *getExceptionSDict() const { return exceptionSDict; } + virtual ClassSDict *getExceptionSDict() const = 0; /*! Returns the namespaces contained in this namespace */ - NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; } - - - QCString title() const; - QCString compoundTypeString() const; - - void setMetaData(const QCString &m); + virtual NamespaceSDict *getNamespaceSDict() const = 0; - bool visited; + virtual QCString title() const = 0; + virtual QCString compoundTypeString() const = 0; - private: - MemberList *createMemberList(MemberListType lt); - void addMemberToList(MemberListType lt,MemberDef *md); - void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title); - void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title); - void writeDetailedDescription(OutputList &ol,const QCString &title); - void writeBriefDescription(OutputList &ol); - void startMemberDeclarations(OutputList &ol); - void endMemberDeclarations(OutputList &ol); - void writeClassDeclarations(OutputList &ol,const QCString &title,ClassSDict *d); - void writeInlineClasses(OutputList &ol); - void writeNamespaceDeclarations(OutputList &ol,const QCString &title, - bool isConstantGroup=false); - void writeMemberGroups(OutputList &ol); - void writeAuthorSection(OutputList &ol); - void startMemberDocumentation(OutputList &ol); - void endMemberDocumentation(OutputList &ol); - void writeSummaryLinks(OutputList &ol); - void addNamespaceAttributes(OutputList &ol); - void writeClassesToTagFile(FTextStream &,ClassSDict *d); - - QCString fileName; - FileList files; - - NamespaceSDict *usingDirList; - SDict<Definition> *usingDeclList; - SDict<Definition> *m_innerCompounds; - - MemberSDict *m_allMembersDict; - QList<MemberList> m_memberLists; - MemberGroupSDict *memberGroupSDict; - ClassSDict *classSDict; - ClassSDict *interfaceSDict; - ClassSDict *structSDict; - ClassSDict *exceptionSDict; - NamespaceSDict *namespaceSDict; - bool m_subGrouping; - enum { NAMESPACE, MODULE, CONSTANT_GROUP, LIBRARY } m_type; - bool m_isPublished; - QCString metaData; - bool m_inline; + virtual void setMetaData(const QCString &m) = 0; + virtual void setVisited(bool v) = 0; + virtual bool isVisited() const = 0; }; +/** Factory method to create new NamespaceDef instance */ +NamespaceDef *createNamespaceDef(const char *defFileName,int defLine,int defColumn, + const char *name,const char *ref=0, + const char *refFile=0,const char*type=0, + bool isPublished=false); + /** A list of NamespaceDef objects. */ class NamespaceList : public QList<NamespaceDef> { |