|
| Private (const FileDef *f) |
|
void | reset () |
|
void | setFileScope (const FileDef *fileScope) |
|
const ClassDef * | getResolvedClassRec (const Definition *scope, const QCString &n, const MemberDef **pTypeDef, QCString *pTemplSpec, QCString *pResolvedType) |
|
int | isAccessibleFrom (AccessStack &accessStack, const Definition *scope, const Definition *item) |
|
int | isAccessibleFromWithExpScope (VisitedNamespaces &visitedNamespaces, AccessStack &accessStack, const Definition *scope, const Definition *item, const QCString &explicitScopePart) |
|
|
void | getResolvedSymbol (const Definition *scope, const Definition *d, const QCString &explicitScopePart, const std::unique_ptr< ArgumentList > &actTemplParams, int &minDistance, const ClassDef *&bestMatch, const MemberDef *&bestTypedef, QCString &bestTemplSpec, QCString &bestResolvedType) |
|
const ClassDef * | newResolveTypedef (const Definition *scope, const MemberDef *md, const MemberDef **pMemType, QCString *pTemplSpec, QCString *pResolvedType, const std::unique_ptr< ArgumentList > &actTemplParams=std::unique_ptr< ArgumentList >()) |
|
const Definition * | followPath (const Definition *start, const QCString &path) |
|
const Definition * | endOfPathIsUsedClass (LinkedRefMap< const ClassDef > cl, const QCString &localName) |
|
bool | accessibleViaUsingNamespace (StringUnorderedSet &visited, const LinkedRefMap< const NamespaceDef > &nl, const Definition *item, const QCString &explicitScopePart="") |
|
bool | accessibleViaUsingClass (const LinkedRefMap< const ClassDef > &cl, const Definition *item, const QCString &explicitScopePart="") |
|
QCString | substTypedef (const Definition *scope, const QCString &name, const MemberDef **pTypeDef=0) |
|
◆ Private()
SymbolResolver::Private::Private |
( |
const FileDef * |
f | ) |
|
|
inline |
◆ accessibleViaUsingClass()
◆ accessibleViaUsingNamespace()
◆ endOfPathIsUsedClass()
◆ followPath()
◆ getResolvedClassRec()
在文件 symbolresolver.cpp 第 166 行定义.
181 &strippedTemplateParams);
182 std::unique_ptr<ArgumentList> actTemplParams;
183 if (!strippedTemplateParams.
isEmpty())
190 if (qualifierIndex!=-1)
193 explicitScopePart=
name.left(qualifierIndex);
209 if (range.first==range.second)
212 if (range.first==range.second)
220 bool hasUsingStatements =
232 int nameLen =
name.length()+1;
233 int explicitPartLen = explicitScopePart.
length();
238 QCString key(scopeNameLen+nameLen+explicitPartLen+fileScopeLen+1);
239 char *pk=key.rawData();
251 if (hasUsingStatements)
271 if (pTemplSpec) *pTemplSpec=pval->
templSpec;
272 if (pTypeDef) *pTypeDef=pval->
typeDef;
291 int minDistance=10000;
293 for (
auto it=range.first ; it!=range.second; ++it)
297 minDistance,bestMatch,bestTypedef,bestTemplSpec,bestResolvedType);
302 *pTypeDef = bestTypedef;
306 *pTemplSpec = bestTemplSpec;
310 *pResolvedType = bestResolvedType;
引用了 FileDef::absFilePath(), LookupInfo::classDef, computeQualifiedIndex(), QCString::data(), LinkedRefMap< T, Hash, KeyEqual, Map >::empty(), SymbolMap< T >::find(), Cache< K, V >::find(), g_cacheMutex, Definition::getLanguage(), getResolvedSymbol(), FileDef::getUsedClasses(), FileDef::getUsedNamespaces(), Cache< K, V >::insert(), QCString::isEmpty(), QCString::left(), QCString::length(), Doxygen::lookupCache, m_fileScope, QCString::mid(), Definition::name(), qstrcpy(), QCString::rawData(), removeRedundantWhiteSpace(), replaceNamespaceAliases(), LookupInfo::resolvedType, QCString::str(), stringToArgumentList(), stripTemplateSpecifiersFromScope(), Doxygen::symbolMap, LookupInfo::templSpec, TRUE , 以及 LookupInfo::typeDef.
◆ getResolvedSymbol()
在文件 symbolresolver.cpp 第 331 行定义.
370 if (distance<minDistance)
372 minDistance=distance;
378 else if (distance==minDistance &&
393 minDistance=distance;
420 if (distance<minDistance)
424 minDistance=distance;
432 bestTemplSpec = spec;
433 bestResolvedType = type;
439 bestTypedef = enumType;
447 bestTemplSpec = spec;
448 bestResolvedType = type;
455 bestResolvedType.
resize(0);
471 if (distance<minDistance)
473 minDistance=distance;
引用了 MemberDef::argsString(), Definition::definitionType(), Definition::getOuterScope(), Doxygen::globalScope, SymbolResolver::isAccessibleFromWithExpScope(), QCString::isEmpty(), MemberDef::isEnumerate(), MemberDef::isReference(), ClassDef::isTemplateArgument(), MemberDef::isTypedef(), MemberDef::qualifiedName(), Definition::qualifiedName(), QCString::resize(), toClassDef(), toMemberDef(), Definition::TypeClass, Definition::TypeMember , 以及 Definition::TypeNamespace.
被这些函数引用 getResolvedClassRec().
◆ isAccessibleFrom()
在文件 symbolresolver.cpp 第 886 行定义.
903 bool memberAccessibleFromScope =
909 bool nestedClassInsideBaseClass =
916 if (itemScope==scope || memberAccessibleFromScope || nestedClassInsideBaseClass)
919 if (nestedClassInsideBaseClass) result++;
964 result= (i==-1) ? -1 : i+2;
引用了 Definition::definitionType(), AccessStack::find(), Definition::getOuterScope(), NamespaceDef::getUsedClasses(), NamespaceDef::getUsedNamespaces(), Doxygen::globalScope, SymbolResolver::isAccessibleFrom(), AccessStack::pop(), AccessStack::push(), toClassDef(), toMemberDef(), toNamespaceDef(), TRUE, Definition::TypeClass, Definition::TypeMember , 以及 Definition::TypeNamespace.
◆ isAccessibleFromWithExpScope()
在文件 symbolresolver.cpp 第 628 行定义.
635 if (explicitScopePart.
isEmpty())
662 if (itemScope==newScope)
666 else if (itemScope && newScope &&
689 visitedNamespaces.insert({newScope->
name().str(),newScope});
705 if (visitedNamespaces.find(nd->name().str())==visitedNamespaces.end())
723 result = (i==-1) ? -1 : i+2;
757 result= (i==-1) ? -1 : i+2;
引用了 Definition::definitionType(), AccessStack::find(), Definition::getOuterScope(), NamespaceDef::getUsedClasses(), NamespaceDef::getUsedNamespaces(), Doxygen::globalScope, SymbolResolver::isAccessibleFrom(), SymbolResolver::isAccessibleFromWithExpScope(), QCString::isEmpty(), Definition::name(), AccessStack::pop(), AccessStack::push(), toClassDef(), toNamespaceDef(), TRUE, Definition::TypeClass , 以及 Definition::TypeNamespace.
◆ newResolveTypedef()
在文件 symbolresolver.cpp 第 490 行定义.
524 actTemplParams && !actTemplParams->empty())
532 while (ip>=0 && (type.
at(ip)==
'*' || type.
at(ip)==
'&' || type.
at(ip)==
' '))
536 type=type.
left(ip+1);
543 while (sp<tl && type.
at(sp)==
' ') sp++;
546 &memTypeDef,0,pResolvedType);
548 if (memTypeDef && memTypeDef->
isTypedef())
553 else if (memTypeDef && memTypeDef->
isEnumerate() && pMemType)
555 *pMemType = memTypeDef;
563 int i=type.
find(
'<');
566 if (pTemplSpec) *pTemplSpec = type.
mid(i);
580 if (pTemplSpec) *pTemplSpec = type.
mid(i);
596 if (sp>0) pResolvedType->
prepend(typedefValue.
left(sp));
597 if (ip<tl-1) pResolvedType->
append(typedefValue.
right(tl-ip-1));
601 *pResolvedType = typedefValue;
617 pTemplSpec ? *pTemplSpec :
QCString(),
618 pResolvedType ? *pResolvedType :
QCString()
引用了 QCString::append(), QCString::at(), MemberDefMutable::cacheTypedefVal(), FALSE, QCString::find(), QCString::findRev(), g_cacheTypedefMutex, MemberDef::getCachedResolvedTypedef(), MemberDef::getCachedTypedefTemplSpec(), MemberDef::getCachedTypedefVal(), MemberDef::getClassDef(), Definition::getDefFileName(), Definition::getOuterScope(), QCString::insert(), MemberDef::isEnumerate(), ClassDef::isTemplate(), MemberDef::isTypedef(), MemberDef::isTypedefValCached(), QCString::left(), QCString::length(), QCString::mid(), QCString::prepend(), MemberDef::qualifiedName(), Definition::qualifiedName(), QCString::right(), QCString::str(), QCString::stripPrefix(), stripTemplateSpecifiersFromScope(), substituteTemplateArgumentsInString(), ClassDef::templateArguments(), toMemberDefMutable() , 以及 MemberDef::typeString().
◆ reset()
void SymbolResolver::Private::reset |
( |
| ) |
|
|
inline |
◆ setFileScope()
void SymbolResolver::Private::setFileScope |
( |
const FileDef * |
fileScope | ) |
|
|
inline |
◆ substTypedef()
◆ m_fileScope
const FileDef* SymbolResolver::Private::m_fileScope |
|
private |
◆ m_resolvedTypedefs
std::unordered_map<std::string,const MemberDef*> SymbolResolver::Private::m_resolvedTypedefs |
|
private |
◆ resolvedType
QCString SymbolResolver::Private::resolvedType |
◆ templateSpec
QCString SymbolResolver::Private::templateSpec |
◆ typeDef
const MemberDef* SymbolResolver::Private::typeDef = 0 |
该结构体的文档由以下文件生成:
Helper class representing the stack of items considered while resolving the scope.
virtual bool isTypedef() const =0
const ClassDef * getResolvedClassRec(const Definition *scope, const QCString &n, const MemberDef **pTypeDef, QCString *pTemplSpec, QCString *pResolvedType)
virtual LinkedRefMap< const NamespaceDef > getUsedNamespaces() const =0
MemberDefMutable * toMemberDefMutable(Definition *d)
virtual QCString argsString() const =0
The common base class of all entity definitions found in the sources.
An abstract interface of a namespace symbol.
QCString substTypedef(const Definition *scope, const QCString &name, const MemberDef **pTypeDef=0)
virtual void cacheTypedefVal(const ClassDef *val, const QCString &templSpec, const QCString &resolvedType)=0
const Definition * followPath(const Definition *start, const QCString &path)
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs)
uint length() const
Returns the length of the string, not counting the 0-terminator.
int findRev(char c, int index=-1, bool cs=TRUE) const
bool isEmpty() const
Returns TRUE iff the string is empty
virtual const Definition * findInnerCompound(const QCString &name) const =0
int isAccessibleFrom(AccessStack &accessStack, const Definition *scope, const Definition *item)
char * qstrcpy(char *dst, const char *src)
MemberDef * toMemberDef(Definition *d)
virtual LinkedRefMap< const ClassDef > getUsedClasses() const =0
static NamespaceDefMutable * globalScope
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped)
const Definition * endOfPathIsUsedClass(LinkedRefMap< const ClassDef > cl, const QCString &localName)
int isAccessibleFromWithExpScope(VisitedNamespaces &visitedNamespaces, AccessStack &accessStack, const Definition *scope, const Definition *item, const QCString &explicitScopePart)
const MemberDef * typeDef
char & at(size_t i)
Returns a reference to the character at index i.
std::unordered_map< std::string, const Definition * > VisitedNamespaces
int find(char c, int index=0, bool cs=TRUE) const
const ClassDef * newResolveTypedef(const Definition *scope, const MemberDef *md, const MemberDef **pMemType, QCString *pTemplSpec, QCString *pResolvedType, const std::unique_ptr< ArgumentList > &actTemplParams=std::unique_ptr< ArgumentList >())
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
static SymbolMap< Definition > * symbolMap
virtual LinkedRefMap< const NamespaceDef > getUsedNamespaces() const =0
std::pair< const_iterator, const_iterator > find(const QCString &name) const
Find the list of symbols stored under key name Returns a pair of iterators pointing to the start and ...
std::unordered_set< std::string > StringUnorderedSet
virtual bool isTypedefValCached() const =0
virtual QCString qualifiedName() const =0
virtual LinkedRefMap< const ClassDef > getUsedClasses() const =0
A model of a class/file/namespace member symbol.
A abstract class representing of a compound symbol.
virtual const ClassDef * getCachedTypedefVal() const =0
QCString left(size_t len) const
QCString & insert(size_t index, const QCString &s)
void push(const Definition *scope, const FileDef *fileScope, const Definition *item)
virtual bool isReference() const =0
QCString removeRedundantWhiteSpace(const QCString &s)
V * insert(const K &key, V &&value)
Inserts value under key in the cache
virtual QCString name() const =0
virtual const ClassDef * getClassDef() const =0
int computeQualifiedIndex(const QCString &name)
ClassDef * toClassDef(Definition *d)
virtual DefType definitionType() const =0
const MemberDef * typeDef
virtual QCString qualifiedName() const =0
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
virtual QCString getCachedResolvedTypedef() const =0
QCString & append(char c)
NamespaceDef * toNamespaceDef(Definition *d)
virtual bool isEnumerate() const =0
virtual Definition * getOuterScope() const =0
virtual QCString absFilePath() const =0
virtual QCString getDefFileName() const =0
V * find(const K &key)
Finds a value in the cache given the corresponding key.
void getResolvedSymbol(const Definition *scope, const Definition *d, const QCString &explicitScopePart, const std::unique_ptr< ArgumentList > &actTemplParams, int &minDistance, const ClassDef *&bestMatch, const MemberDef *&bestTypedef, QCString &bestTemplSpec, QCString &bestResolvedType)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
static Cache< std::string, LookupInfo > * lookupCache
const ClassDef * classDef
FileDef * toFileDef(Definition *d)
bool accessibleViaUsingNamespace(StringUnorderedSet &visited, const LinkedRefMap< const NamespaceDef > &nl, const Definition *item, const QCString &explicitScopePart="")
static std::recursive_mutex g_cacheTypedefMutex
virtual bool isTemplateArgument() const =0
std::unordered_map< std::string, const MemberDef * > m_resolvedTypedefs
bool find(const Definition *scope, const FileDef *fileScope, const Definition *item)
int getScopeFragment(const QCString &s, int p, int *l)
void replaceNamespaceAliases(QCString &scope, int i)
virtual QCString typeString() const =0
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
bool stripPrefix(const QCString &prefix)
QCString right(size_t len) const
QCString & prepend(const char *s)
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
static std::mutex g_cacheMutex
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class
bool accessibleViaUsingClass(const LinkedRefMap< const ClassDef > &cl, const Definition *item, const QCString &explicitScopePart="")
virtual bool isTemplate() const =0
Returns TRUE if this class is a template
const FileDef * m_fileScope
virtual QCString getCachedTypedefTemplSpec() const =0
This is an alternative implementation of QCString.