memberhandler.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * $Id$
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  */
15 
16 #ifndef _MEMBERHANDLER_H
17 #define _MEMBERHANDLER_H
18 
19 #include <qstring.h>
20 #include <qlist.h>
21 #include <qxml.h>
22 #include <doxmlintf.h>
23 
24 #include "basehandler.h"
25 #include "baseiterator.h"
26 #include "stringimpl.h"
27 
28 class MainHandler;
29 class CompoundHandler;
30 class SectionHandler;
31 class ParamHandler;
32 class LinkedTextImpl;
33 class LinkedTextHandler;
34 class DocHandler;
35 
37 {
38  public:
39  virtual ~MemberReference() {}
40  virtual IMember *member() const;
41  virtual const IString *name() const { return &m_name; }
42  virtual const IString *scope() const { return &m_scope; }
43  virtual const IString *protection() const { return &m_protection; }
44  virtual const IString *virtualness() const { return &m_virtualness; }
45  virtual const IString *ambiguityScope() const { return &m_ambiguityScope; }
46  void initialize(MainHandler *m);
47 
55 };
56 
57 class MemberReferenceIterator : public BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>
58 {
59  public:
62 };
63 
64 class MemberHandler : public IDefine,
65  public IProperty,
66  public IVariable,
67  public ITypedef,
68  public IFunction,
69  public ISignal,
70  public IPrototype,
71  public IFriend,
72  public IDCOP,
73  public ISlot,
74  public IEnum,
75  public IEnumValue,
76  public BaseHandler<MemberHandler>
77 {
78  public:
79  virtual void startMember(const QXmlAttributes& attrib);
80  virtual void endMember();
81  virtual void startParam(const QXmlAttributes& attrib);
82  virtual void startType(const QXmlAttributes& attrib);
83  virtual void startName(const QXmlAttributes& attrib);
84  virtual void endName();
85  virtual void startRead(const QXmlAttributes& attrib);
86  virtual void endRead();
87  virtual void startWrite(const QXmlAttributes& attrib);
88  virtual void endWrite();
89  virtual void startDefinition(const QXmlAttributes& attrib);
90  virtual void endDefinition();
91  virtual void startArgsString(const QXmlAttributes& attrib);
92  virtual void endArgsString();
93  virtual void startBriefDesc(const QXmlAttributes& attrib);
94  virtual void startDetailedDesc(const QXmlAttributes& attrib);
95  virtual void startInbodyDesc(const QXmlAttributes& attrib);
96  virtual void startLocation(const QXmlAttributes& attrib);
97  virtual void startReferences(const QXmlAttributes& attrib);
98  virtual void endReferences();
99  virtual void startReferencedBy(const QXmlAttributes& attrib);
100  virtual void endReferencedBy();
101  virtual void startReimplements(const QXmlAttributes& attrib);
102  virtual void endReimplements();
103  virtual void startReimplementedBy(const QXmlAttributes& attrib);
104  virtual void endReimplementedBy();
105  virtual void startInitializer(const QXmlAttributes& attrib);
106  virtual void startException(const QXmlAttributes& attrib);
107  virtual void startEnumValue(const QXmlAttributes& attrib);
108  virtual void startEnumValue2(const QXmlAttributes& attrib);
109  virtual void startTemplateParamList(const QXmlAttributes &attrib);
110  virtual void endTemplateParamList();
111 
113  virtual ~MemberHandler();
114 
115  // IMember implementation
116  virtual ICompound *compound() const;
117  virtual ISection *section() const;
118  virtual MemberKind kind() const
119  { return m_kind; }
120  virtual const IString *kindString() const
121  { return &m_kindString; }
122  virtual const IString *id() const
123  { return &m_id; }
124  virtual const IString *protection() const
125  { return &m_protection; }
126  virtual const IString *virtualness() const
127  { return &m_virtualness; }
128  virtual const IString *name() const
129  { return &m_name; }
130  virtual const IString *readAccessor() const
131  { return &m_read; }
132  virtual const IString *writeAccessor() const
133  { return &m_write; }
134  virtual const IString *definition() const
135  { return &m_definition; }
136  virtual const IString *argsstring() const
137  { return &m_argsstring; }
138  virtual bool isConst() const
139  { return m_isConst; }
140  virtual bool isVolatile() const
141  { return m_isVolatile; }
142  virtual bool isStatic() const
143  { return m_isStatic; }
144  virtual bool isExplicit() const
145  { return m_isExplicit; }
146  virtual bool isInline() const
147  { return m_isInline; }
148  virtual bool isMutable() const
149  { return m_isMutable; }
150  virtual bool isReadable() const
151  { return m_isReadable; }
152  virtual bool isWritable() const
153  { return m_isWritable; }
154  virtual ILinkedTextIterator *type() const;
155  virtual const IString *typeString() const;
156  virtual IParamIterator *parameters() const;
157  virtual IParamIterator *templateParameters() const;
158  virtual IMemberReferenceIterator *references() const;
159  virtual IMemberReferenceIterator *referencedBy() const;
160  virtual ILinkedTextIterator *initializer() const;
161  virtual ILinkedTextIterator *exceptions() const;
162  virtual const IString *bodyFile() const
163  { return &m_bodyFile; }
164  virtual int bodyStart() const
165  { return m_bodyStart; }
166  virtual int bodyEnd() const
167  { return m_bodyEnd; }
168  virtual const IString *definitionFile() const
169  { return &m_defFile; }
170  virtual int definitionLine() const
171  { return m_defLine; }
173  { return m_reimplements; }
174  virtual IMemberReferenceIterator *reimplementedBy() const;
175  virtual IDocRoot *briefDescription() const;
176  virtual IDocRoot *detailedDescription() const;
177  virtual IDocRoot *inbodyDescription() const;
178 
179  // IEnum
180  virtual IMemberIterator *enumValues() const;
181 
182  void initialize(MainHandler *m);
183  void setCompoundHandler(CompoundHandler *c);
184  void setSectionHandler(SectionHandler *s);
185 
186  private:
187  // XML elements:
188  // -----------------
189  QList<ParamHandler> m_templateParams; // templateparamlist
191  StringImpl m_definition; // definition
192  StringImpl m_argsstring; // argsstring
195  StringImpl m_write; // write
196  MemberReference *m_reimplements; // reimplements
202  DocHandler *m_brief; // briefdescription
203  DocHandler *m_detailed; // detaileddescription
204  DocHandler *m_inbody; // inbodydescription
205  // location
207  int m_defLine; // - line
208  StringImpl m_bodyFile; // - bodyfile
209  int m_bodyStart; // - bodystart
210  int m_bodyEnd; // - bodyend
213 
214  // XML attributes:
215  // ---------------
217  StringImpl m_kindString; // kind as a string
220  bool m_isStatic; // static
221  bool m_isConst; // const
222  bool m_isExplicit; // explicit
223  bool m_isInline; // inline
225  bool m_isVolatile; // volatile
226  bool m_isMutable; // mutable
227  bool m_isReadable; // readable
228  bool m_isWritable; // writable
229 
237 };
238 
239 class MemberIterator : public BaseIteratorVia<IMemberIterator,
240  IMember,
241  MemberHandler,
242  IFunction>
243 {
244  public:
247 };
248 
249 void memberhandler_init();
250 void memberhandler_exit();
251 
252 #endif
virtual bool isMutable() const
virtual const IString * protection() const
Definition: memberhandler.h:43
Read only interface to a string.
Definition: doxmlintf.h:42
virtual const IString * protection() const
virtual const IString * virtualness() const
Definition: memberhandler.h:44
void initialize(MainHandler *m)
IBaseHandler * m_parent
virtual const IString * id() const
virtual bool isVolatile() const
virtual bool isConst() const
QList< LinkedTextImpl > m_type
StringImpl m_virtualness
virtual const IString * definition() const
QList< MemberReference > m_references
void memberhandler_exit()
virtual const IString * ambiguityScope() const
Definition: memberhandler.h:45
virtual const IString * definitionFile() const
bool m_insideTemplateParamList
static QCString initializer
virtual ~MemberReference()
Definition: memberhandler.h:39
bool m_hasTemplateParamList
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
virtual const IString * scope() const
Definition: memberhandler.h:42
QList< MemberReference > m_reimplementedBy
StringImpl m_protection
virtual bool isWritable() const
StringImpl m_protection
Definition: memberhandler.h:52
MemberKind m_kind
QList< ParamHandler > m_params
StringImpl m_typeString
StringImpl m_definition
StringImpl m_write
QList< MemberHandler > m_enumValues
QList< ParamHandler > m_templateParams
virtual bool isReadable() const
QList< LinkedTextImpl > m_initializer
virtual const IString * writeAccessor() const
virtual bool isExplicit() const
virtual const IString * readAccessor() const
virtual int definitionLine() const
StringImpl m_scope
Definition: memberhandler.h:50
DocHandler * m_inbody
Node representing a documentation block.
Definition: dochandler.h:1315
DocHandler * m_brief
The interface to a compound in the object model.
Definition: doxmlintf.h:868
MemberReferenceIterator(const QList< MemberReference > &list)
Definition: memberhandler.h:60
The interface to a section in the object model.
Definition: doxmlintf.h:747
Iterates over a list of ILinkedText fragments.
Definition: doxmlintf.h:97
virtual int bodyEnd() const
virtual const IString * virtualness() const
virtual bool isInline() const
virtual const IString * argsstring() const
StringImpl m_name
MemberIterator(const QList< MemberHandler > &list)
SectionHandler * m_section
void memberhandler_init()
virtual const IString * kindString() const
virtual MemberKind kind() const
virtual bool isStatic() const
static QCString type
Definition: declinfo.cpp:672
virtual IMemberReference * reimplements() const
StringImpl m_argsstring
The QXmlAttributes class provides XML attributes.
Definition: qxml.h:128
StringImpl m_name
Definition: memberhandler.h:49
virtual const IString * name() const
MemberReference * m_reimplements
StringImpl m_defFile
QList< MemberReference > m_referencedBy
LinkedTextHandler * m_linkedTextHandler
virtual const IString * name() const
Definition: memberhandler.h:41
MainHandler * m_mainHandler
Definition: memberhandler.h:54
StringImpl m_read
virtual const IString * bodyFile() const
StringImpl m_kindString
virtual int bodyStart() const
StringImpl m_ambiguityScope
Definition: memberhandler.h:53
QList< LinkedTextImpl > m_exception
static QCString * s
Definition: config.cpp:1042
def parent(G, child, parent_type)
Definition: graph.py:67
virtual IMember * member() const
DocHandler * m_detailed
StringImpl m_id
CompoundHandler * m_compound
StringImpl m_bodyFile
The interface to the object model provided by the XML parser library.
StringImpl m_virtualness
Definition: memberhandler.h:51