Doxygen
Loading...
Searching...
No Matches
namespacedef.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#ifndef NAMESPACEDEF_H
17#define NAMESPACEDEF_H
18
19#include <memory>
20#include <unordered_set>
21
22#include "definition.h"
23#include "filedef.h"
24#include "linkedmap.h"
25#include "membergroup.h"
26
27class MemberList;
28class ClassDef;
29class ConceptDef;
30class OutputList;
33class MemberDef;
34class NamespaceDef;
36
37// --- Set of namespaces
38
39using NamespaceDefSet = std::unordered_set<const NamespaceDef*>;
40
41class NamespaceLinkedMap : public LinkedMap<NamespaceDef>
42{
43};
44
45class NamespaceLinkedRefMap : public LinkedRefMap<const NamespaceDef>
46{
47 public:
48 void writeDeclaration(OutputList &ol,const QCString &title,
49 bool isConstantGroup=false, bool localName=FALSE);
50 bool declVisible(bool isContantGroup) const;
51};
52
53/** An abstract interface of a namespace symbol. */
55{
56 public:
58
59 // ---- getters
60 virtual int numDocMembers() const = 0;
61 virtual const LinkedRefMap<NamespaceDef> &getUsedNamespaces() const = 0;
62 virtual const LinkedRefMap<const Definition> &getUsedDefinitions() const = 0;
63 virtual bool isConstantGroup() const = 0;
64 virtual bool isModule() const = 0;
65 virtual bool isLibrary() const = 0;
66 virtual bool isInline() const = 0;
67 virtual bool isVisibleInHierarchy() const = 0;
68 virtual bool hasDetailedDescription() const = 0;
69 virtual bool subGrouping() const = 0;
70 virtual MemberList *getMemberList(MemberListType lt) const = 0;
71 virtual const MemberLists &getMemberLists() const = 0;
72 virtual const MemberDef *getMemberByName(const QCString &) const = 0;
73 virtual int countVisibleMembers() const = 0;
74
75 /*! Returns the user defined member groups */
76 virtual const MemberGroupList &getMemberGroups() const = 0;
77
78 /*! Returns the classes contained in this namespace */
79 virtual ClassLinkedRefMap getClasses() const = 0;
80
81 /*! Returns the Slice interfaces contained in this namespace */
82 virtual ClassLinkedRefMap getInterfaces() const = 0;
83
84 /*! Returns the Slice structs contained in this namespace */
85 virtual ClassLinkedRefMap getStructs() const = 0;
86
87 /*! Returns the Slice exceptions contained in this namespace */
88 virtual ClassLinkedRefMap getExceptions() const = 0;
89
90 /*! Returns the namespaces contained in this namespace */
92
93 /*! Returns the concepts contained in this namespace */
94 virtual ConceptLinkedRefMap getConcepts() const = 0;
95
96 virtual QCString title() const = 0;
97 virtual QCString compoundTypeString() const = 0;
98};
99
101{
102 public:
104
105 // --- setters/actions
106 virtual void setMetaData(const QCString &m) = 0;
107 virtual void insertUsedFile(FileDef *fd) = 0;
108 virtual void writeDocumentation(OutputList &ol) = 0;
109 virtual void writeMemberPages(OutputList &ol) = 0;
110 virtual void writeTagFile(TextStream &) = 0;
111 virtual void insertClass(ClassDef *cd) = 0;
112 virtual void insertConcept(ConceptDef *cd) = 0;
113 virtual void insertNamespace(NamespaceDef *nd) = 0;
114 virtual void insertMember(MemberDef *md) = 0;
115 virtual void computeAnchors() = 0;
116 virtual void countMembers() = 0;
117 virtual void addMembersToMemberGroup() = 0;
119 virtual void findSectionsInDocumentation() = 0;
120 virtual void sortMemberLists() = 0;
121 virtual void addListReferences() = 0;
122 virtual void setFileName(const QCString &fn) = 0;
123 virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace) = 0;
124 virtual void addUsingDirective(NamespaceDef *nd) = 0;
125 virtual void addUsingDeclaration(const Definition *d) = 0;
126 virtual void setInline(bool isInline) = 0;
127};
128
129/** Factory method to create new NamespaceDef instance */
130std::unique_ptr<NamespaceDef> createNamespaceDef(const QCString &defFileName,int defLine,int defColumn,
131 const QCString &name,const QCString &ref=QCString(),
132 const QCString &refFile=QCString(),const QCString &type=QCString(),
133 bool isPublished=false);
134
135/** Factory method to create an alias of an existing namespace. Used for inline namespaces. */
136std::unique_ptr<NamespaceDef> createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd);
137
138
139// --- Cast functions
140
143const NamespaceDef *toNamespaceDef(const Definition *d);
145
146// --- Helpers
147
154bool namespaceHasNestedNamespace(const NamespaceDef *nd);
155bool namespaceHasNestedConcept(const NamespaceDef *nd);
156bool namespaceHasNestedClass(const NamespaceDef *nd,bool filterClasses,ClassDef::CompoundType ct);
157
158//------------------------------------------------------------------------
159
160#endif
A abstract class representing of a compound symbol.
Definition classdef.h:104
CompoundType
The various compound types.
Definition classdef.h:109
The common base class of all entity definitions found in the sources.
Definition definition.h:76
virtual const QCString & name() const =0
A model of a file symbol.
Definition filedef.h:99
Container class representing a vector of objects with keys.
Definition linkedmap.h:36
Container class representing a vector of objects with keys.
Definition linkedmap.h:232
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:108
Wrapper class for the MemberListType type.
Definition types.h:184
An abstract interface of a namespace symbol.
virtual bool isLibrary() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual bool isConstantGroup() const =0
virtual ConceptLinkedRefMap getConcepts() const =0
virtual ClassLinkedRefMap getStructs() const =0
virtual QCString compoundTypeString() const =0
virtual const LinkedRefMap< NamespaceDef > & getUsedNamespaces() const =0
virtual ClassLinkedRefMap getExceptions() const =0
virtual const MemberLists & getMemberLists() const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual bool isModule() const =0
virtual bool subGrouping() const =0
virtual int countVisibleMembers() const =0
virtual int numDocMembers() const =0
virtual bool hasDetailedDescription() const =0
virtual bool isInline() const =0
virtual bool isVisibleInHierarchy() const =0
virtual const MemberDef * getMemberByName(const QCString &) const =0
virtual QCString title() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual ClassLinkedRefMap getInterfaces() const =0
virtual const LinkedRefMap< const Definition > & getUsedDefinitions() const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual void insertClass(ClassDef *cd)=0
virtual void insertUsedFile(FileDef *fd)=0
virtual void setMetaData(const QCString &m)=0
virtual void findSectionsInDocumentation()=0
virtual void countMembers()=0
virtual void addUsingDirective(NamespaceDef *nd)=0
virtual void insertMember(MemberDef *md)=0
virtual void insertConcept(ConceptDef *cd)=0
virtual void addUsingDeclaration(const Definition *d)=0
virtual void distributeMemberGroupDocumentation()=0
virtual void writeTagFile(TextStream &)=0
virtual void insertNamespace(NamespaceDef *nd)=0
virtual void addListReferences()=0
virtual void writeDocumentation(OutputList &ol)=0
virtual void setInline(bool isInline)=0
virtual void computeAnchors()=0
virtual void combineUsingRelations(NamespaceDefSet &visitedNamespace)=0
virtual void setFileName(const QCString &fn)=0
virtual void writeMemberPages(OutputList &ol)=0
virtual void sortMemberLists()=0
virtual void addMembersToMemberGroup()=0
void writeDeclaration(OutputList &ol, const QCString &title, bool isConstantGroup=false, bool localName=FALSE)
bool declVisible(bool isContantGroup) const
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
This is an alternative implementation of QCString.
Definition qcstring.h:101
Text streaming class that buffers data.
Definition textstream.h:36
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
Definition construct.h:20
NamespaceDefMutable * getResolvedNamespaceMutable(const QCString &key)
bool namespaceHasNestedNamespace(const NamespaceDef *nd)
void replaceNamespaceAliases(QCString &name)
bool namespaceHasNestedClass(const NamespaceDef *nd, bool filterClasses, ClassDef::CompoundType ct)
std::unique_ptr< NamespaceDef > createNamespaceDefAlias(const Definition *newScope, const NamespaceDef *nd)
Factory method to create an alias of an existing namespace.
std::unique_ptr< NamespaceDef > createNamespaceDef(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const QCString &ref=QCString(), const QCString &refFile=QCString(), const QCString &type=QCString(), bool isPublished=false)
Factory method to create new NamespaceDef instance.
std::unordered_set< const NamespaceDef * > NamespaceDefSet
NamespaceDef * getResolvedNamespace(const QCString &key)
NamespaceDef * toNamespaceDef(Definition *d)
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
bool namespaceHasNestedConcept(const NamespaceDef *nd)
#define FALSE
Definition qcstring.h:34