浏览该文件的文档.
16 #ifndef SCOPEDTYPEVARIANT_H
17 #define SCOPEDTYPEVARIANT_H
182 using Scope = std::unordered_map<std::string,ScopedTypeVariant>;
207 scope->emplace(std::make_pair(name.
str(),std::move(stv)));
212 if (name.
isEmpty())
return result;
218 auto it2 = it->find(name.
str());
221 result = &it2->second;
230 result = &it2->second;
262 ctx.
stv=std::move(stv);
void setScope(const ScopedTypeVariant &stv)
const Definition * globalDef() const
Implementation of a variant container (similar to C++17's std::variant).
The common base class of all entity definitions found in the sources.
bool atGlobalScope() const
void addVariable(const QCString &name, ScopedTypeVariant stv)
const ScopedTypeVariant getScope() const
bool isEmpty() const
Returns TRUE iff the string is empty
void insertBaseClass(const QCString &name)
ScopedTypeVariant(const Definition *d)
constructor for creating a variant of type Global
Ctx(const QCString &name_, const QCString &type_)
~ScopedTypeVariant()
destructor
std::vector< Scope > m_scopes
union ScopedTypeVariant::@3 m_u
friend void swap(ScopedTypeVariant &first, ScopedTypeVariant &second)
swap function
ScopedTypeVariant(ScopedTypeVariant &&stv) noexcept
move constructor
DirIterator end(const DirIterator &) noexcept
void setDummy()
Turn the variant into a Dummy type
LocalDef * setLocal(const QCString &name)
Turn the variant into a Local type
void pushScope(const QCString &name_, const QCString &type_)
virtual QCString name() const =0
LocalDef * localDef() const
ScopedTypeVariant(const ScopedTypeVariant &stv)
copy constructor
std::vector< QCString > baseClasses() const
Class representing a local class definition found while generating syntax highlighted code.
const ScopedTypeVariant * findVariable(const QCString &name)
void popScope(QCString &name_, QCString &type_)
Represents the call context
ScopedTypeVariant()
default constructor for creating a variant of type Dummy
const Definition * globalDef
void setGlobal(const Definition *def)
Turn the variant into a Global type
std::vector< Ctx > m_stvList
std::vector< QCString > m_baseClasses
ScopedTypeVariant & operator=(ScopedTypeVariant stv)
assignment operator
ScopedTypeVariant(const QCString &name)
constructor for creating a variant of type Local
std::unordered_map< std::string, ScopedTypeVariant > Scope
This is an alternative implementation of QCString.