Doxygen
membername.h
浏览该文件的文档.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #ifndef MEMBERNAME_H
19 #define MEMBERNAME_H
20 
21 #include "memberdef.h"
22 #include "linkedmap.h"
23 
25 {
26  public:
27  using Ptr = std::unique_ptr<MemberDef>;
28  using Vec = std::vector<Ptr>;
29  using iterator = typename Vec::iterator;
30  using const_iterator = typename Vec::const_iterator;
31  using reverse_iterator = typename Vec::reverse_iterator;
32  using const_reverse_iterator = typename Vec::const_reverse_iterator;
33 
34  MemberName(const QCString &name) : m_name(name) {}
35  QCString memberName() const { return m_name; }
36 
37  iterator begin() { return m_members.begin(); }
38  iterator end() { return m_members.end(); }
39  const_iterator begin() const { return m_members.begin(); }
40  const_iterator end() const { return m_members.end(); }
41  const_iterator cbegin() const { return m_members.cbegin(); }
42  const_iterator cend() const { return m_members.cend(); }
43  reverse_iterator rbegin() { return m_members.rbegin(); }
44  reverse_iterator rend() { return m_members.rend(); }
45  const_reverse_iterator crbegin() const { return m_members.crbegin(); }
46  const_reverse_iterator crend() const { return m_members.crend(); }
47  bool empty() const { return m_members.empty(); }
48  size_t size() const { return m_members.size(); }
49  Ptr &back() { return m_members.back(); }
50  const Ptr &back() const { return m_members.back(); }
51  Ptr &front() { return m_members.front(); }
52  const Ptr &front() const { return m_members.front(); }
53  void push_back(Ptr &&p) { m_members.push_back(std::move(p)); }
54 
55  private:
58 };
59 
60 /** Ordered dictionary of MemberName objects. */
61 class MemberNameLinkedMap : public LinkedMap<MemberName>
62 {
63 };
64 
65 /** Data associated with a MemberDef in an inheritance relation. */
67 {
68  public:
69  MemberInfo(const MemberDef *md,Protection p,Specifier v,bool inh) :
70  m_memberDef(md), m_prot(p), m_virt(v), m_inherited(inh) {}
72 
73  // getters
74  const MemberDef *memberDef() { return m_memberDef; }
75  const MemberDef *memberDef() const { return m_memberDef; }
76  Protection prot() const { return m_prot; }
77  Specifier virt() const { return m_virt; }
78  bool inherited() const { return m_inherited; }
79  QCString scopePath() const { return m_scopePath; }
81  const ClassDef *ambigClass() const { return m_ambigClass; }
82 
83  // setters
85  void setScopePath(const QCString &s) { m_scopePath = s; }
86  void setAmbigClass(const ClassDef *cd) { m_ambigClass = cd; }
87 
88  private:
95  const ClassDef *m_ambigClass = 0;
96 };
97 
99 {
100  public:
101  using Ptr = std::unique_ptr<MemberInfo>;
102  using Vec = std::vector<Ptr>;
103  using iterator = typename Vec::iterator;
104  using const_iterator = typename Vec::const_iterator;
105 
106  MemberNameInfo(const QCString &name) : m_name(name) {}
107  QCString memberName() const { return m_name; }
108 
109  iterator begin() { return m_members.begin(); }
110  iterator end() { return m_members.end(); }
111  const_iterator begin() const { return m_members.begin(); }
112  const_iterator end() const { return m_members.end(); }
113  bool empty() const { return m_members.empty(); }
114  size_t size() const { return m_members.size(); }
115  Ptr &back() { return m_members.back(); }
116  const Ptr &back() const { return m_members.back(); }
117  Ptr &front() { return m_members.front(); }
118  const Ptr &front() const { return m_members.front(); }
119  void push_back(Ptr &&p) { m_members.push_back(std::move(p)); }
120 
121  private:
124 };
125 
126 class MemberNameInfoLinkedMap : public LinkedMap<MemberNameInfo>
127 {
128 };
129 
130 #endif
MemberInfo::inherited
bool inherited() const
Definition: membername.h:78
MemberInfo::scopePath
QCString scopePath() const
Definition: membername.h:79
MemberNameInfo::end
const_iterator end() const
Definition: membername.h:112
MemberInfo
Data associated with a MemberDef in an inheritance relation.
Definition: membername.h:66
Protection
Protection
Protection level of members
Definition: types.h:26
MemberInfo::setAmbigClass
void setAmbigClass(const ClassDef *cd)
Definition: membername.h:86
MemberNameInfo::Ptr
std::unique_ptr< MemberInfo > Ptr
Definition: membername.h:101
memberdef.h
MemberInfo::ambigClass
const ClassDef * ambigClass() const
Definition: membername.h:81
MemberName::push_back
void push_back(Ptr &&p)
Definition: membername.h:68
MemberName::back
Ptr & back()
Definition: membername.h:64
MemberInfo::m_memberDef
const MemberDef * m_memberDef
Definition: membername.h:89
MemberName::Vec
std::vector< Ptr > Vec
Definition: membername.h:43
MemberNameInfo::size
size_t size() const
Definition: membername.h:114
MemberInfo::virt
Specifier virt() const
Definition: membername.h:77
Specifier
Specifier
Virtualness of a member.
Definition: types.h:29
MemberNameInfo::iterator
typename Vec::iterator iterator
Definition: membername.h:103
MemberNameInfo::end
iterator end()
Definition: membername.h:110
MemberName::crend
const_reverse_iterator crend() const
Definition: membername.h:61
MemberInfo::MemberInfo
MemberInfo(const MemberDef *md, Protection p, Specifier v, bool inh)
Definition: membername.h:69
MemberName::front
Ptr & front()
Definition: membername.h:66
MemberName::begin
iterator begin()
Definition: membername.h:52
linkedmap.h
MemberNameInfo::Vec
std::vector< Ptr > Vec
Definition: membername.h:102
MemberName::reverse_iterator
typename Vec::reverse_iterator reverse_iterator
Definition: membername.h:46
MemberName
Definition: membername.h:24
MemberInfo::m_ambiguityResolutionScope
QCString m_ambiguityResolutionScope
Definition: membername.h:94
MemberName::const_iterator
typename Vec::const_iterator const_iterator
Definition: membername.h:45
MemberNameInfoLinkedMap
Definition: membername.h:126
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
MemberInfo::m_scopePath
QCString m_scopePath
Definition: membername.h:93
ClassDef
A abstract class representing of a compound symbol.
Definition: classdef.h:103
MemberInfo::~MemberInfo
~MemberInfo()
Definition: membername.h:71
MemberInfo::m_ambigClass
const ClassDef * m_ambigClass
Definition: membername.h:95
MemberNameInfo
Definition: membername.h:98
MemberNameInfo::front
const Ptr & front() const
Definition: membername.h:118
MemberInfo::setScopePath
void setScopePath(const QCString &s)
Definition: membername.h:85
MemberInfo::prot
Protection prot() const
Definition: membername.h:76
MemberNameLinkedMap
Ordered dictionary of MemberName objects.
Definition: membername.h:61
MemberInfo::ambiguityResolutionScope
QCString ambiguityResolutionScope() const
Definition: membername.h:80
MemberNameInfo::MemberNameInfo
MemberNameInfo(const QCString &name)
Definition: membername.h:106
MemberNameInfo::back
const Ptr & back() const
Definition: membername.h:116
MemberNameInfo::begin
iterator begin()
Definition: membername.h:109
MemberName::rend
reverse_iterator rend()
Definition: membername.h:59
MemberNameInfo::begin
const_iterator begin() const
Definition: membername.h:111
MemberNameInfo::m_name
QCString m_name
Definition: membername.h:122
MemberName::m_name
QCString m_name
Definition: membername.h:71
MemberInfo::m_inherited
bool m_inherited
Definition: membername.h:92
MemberName::end
iterator end()
Definition: membername.h:53
MemberName::cend
const_iterator cend() const
Definition: membername.h:57
MemberNameInfo::back
Ptr & back()
Definition: membername.h:115
MemberName::memberName
QCString memberName() const
Definition: membername.h:50
MemberNameInfo::memberName
QCString memberName() const
Definition: membername.h:107
MemberInfo::memberDef
const MemberDef * memberDef() const
Definition: membername.h:75
MemberNameInfo::m_members
Vec m_members
Definition: membername.h:123
MemberName::iterator
typename Vec::iterator iterator
Definition: membername.h:44
MemberName::empty
bool empty() const
Definition: membername.h:62
MemberName::m_members
Vec m_members
Definition: membername.h:72
MemberInfo::m_virt
Specifier m_virt
Definition: membername.h:91
MemberInfo::setAmbiguityResolutionScope
void setAmbiguityResolutionScope(const QCString &s)
Definition: membername.h:84
MemberName::size
size_t size() const
Definition: membername.h:63
MemberNameInfo::const_iterator
typename Vec::const_iterator const_iterator
Definition: membername.h:104
MemberNameInfo::front
Ptr & front()
Definition: membername.h:117
MemberName::cbegin
const_iterator cbegin() const
Definition: membername.h:56
MemberNameInfo::empty
bool empty() const
Definition: membername.h:113
LinkedMap
Container class representing a vector of objects with keys.
Definition: linkedmap.h:35
MemberName::crbegin
const_reverse_iterator crbegin() const
Definition: membername.h:60
MemberName::const_reverse_iterator
typename Vec::const_reverse_iterator const_reverse_iterator
Definition: membername.h:47
MemberInfo::m_prot
Protection m_prot
Definition: membername.h:90
MemberName::MemberName
MemberName(const QCString &name)
Definition: membername.h:49
MemberName::Ptr
std::unique_ptr< MemberDef > Ptr
Definition: membername.h:42
MemberInfo::memberDef
const MemberDef * memberDef()
Definition: membername.h:74
MemberName::rbegin
reverse_iterator rbegin()
Definition: membername.h:58
MemberNameInfo::push_back
void push_back(Ptr &&p)
Definition: membername.h:119
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108