Doxygen
Loading...
Searching...
No Matches
conceptdef.cpp File Reference
#include "conceptdef.h"
#include "config.h"
#include "definitionimpl.h"
#include "doxygen.h"
#include "language.h"
#include "layout.h"
#include "message.h"
#include "namespacedef.h"
#include "outputlist.h"
#include "parserintf.h"
#include "util.h"
Include dependency graph for conceptdef.cpp:

Go to the source code of this file.

Classes

class  ConceptDefImpl
class  ConceptDefAliasImpl

Functions

std::unique_ptr< ConceptDef > createConceptDef (const DString &fileName, int startLine, size_t startColumn, const DString &name, const DString &tagRef, const DString &tagFile)
std::unique_ptr< ConceptDef > createConceptDefAlias (const Definition *newScope, const ConceptDef *cd)
static DString templateSpec (const ArgumentList &al)
ConceptDef * toConceptDef (Definition *d)
ConceptDef * toConceptDef (DefinitionMutable *md)
const ConceptDef * toConceptDef (const Definition *d)
ConceptDefMutable * toConceptDefMutable (Definition *d)
ConceptDef * getConcept (const DString &n)
ConceptDef * getResolvedConcept (const Definition *d, const DString &name)

Function Documentation

◆ createConceptDef()

std::unique_ptr< ConceptDef > createConceptDef ( const DString & fileName,
int startLine,
size_t startColumn,
const DString & name,
const DString & tagRef,
const DString & tagFile )

Definition at line 96 of file conceptdef.cpp.

99{
100 return std::make_unique<ConceptDefImpl>(fileName,startLine,startColumn,name,tagRef,tagFile);
101}

Referenced by ConceptDefMutable::addCodePart(), and addConceptToContext().

◆ createConceptDefAlias()

std::unique_ptr< ConceptDef > createConceptDefAlias ( const Definition * newScope,
const ConceptDef * cd )

Definition at line 157 of file conceptdef.cpp.

158{
159 return std::make_unique<ConceptDefAliasImpl>(newScope,cd);
160}

Referenced by ConceptDefMutable::addCodePart().

◆ getConcept()

ConceptDef * getConcept ( const DString & n)

Definition at line 872 of file conceptdef.cpp.

873{
874 if (n.empty()) return nullptr;
876}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:90
const T * find(const std::string &key) const
Definition linkedmap.h:47

References Doxygen::conceptLinkedMap, DString::empty(), and LinkedMap< T, Hash, KeyEqual, Map >::find().

Referenced by getConceptMutable(), getResolvedConcept(), linkifyText(), and resolveLink().

◆ getResolvedConcept()

ConceptDef * getResolvedConcept ( const Definition * d,
const DString & name )

Definition at line 878 of file conceptdef.cpp.

879{
880 ConceptDef *cd=nullptr;
881 while (d && d!=Doxygen::globalScope)
882 {
883 cd = getConcept(d->name()+"::"+name);
884 if (cd) return cd;
885 d = d->getOuterScope();
886 }
887 cd = getConcept(name);
888 return cd;
889}
virtual const DString & name() const =0
virtual Definition * getOuterScope() const =0
static NamespaceDefMutable * globalScope
Definition doxygen.h:114
ConceptDef * getConcept(const DString &n)

References getConcept(), Definition::getOuterScope(), Doxygen::globalScope, and Definition::name().

Referenced by generateClassOrGlobalLink().

◆ templateSpec()

DString templateSpec ( const ArgumentList & al)
static

Definition at line 428 of file conceptdef.cpp.

429{
430 TextStream t;
431 t << "template<";
432 bool first=true;
433 for (const auto &a : al)
434 {
435 if (!first) t << ", ";
436 t << a.type;
437 if (!a.name.empty())
438 {
439 t << " " << a.name;
440 }
441 if (a.defval.length()!=0)
442 {
443 t << " " << a.defval;
444 }
445 first=false;
446 }
447 t << ">";
448 return t.str();
449}
Text streaming class that buffers data.
Definition textstream.h:36
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:232

References TextStream::str().

Referenced by ConceptDefImpl::setInitializer().

◆ toConceptDef() [1/3]

const ConceptDef * toConceptDef ( const Definition * d)

Definition at line 846 of file conceptdef.cpp.

847{
848 if (d && (typeid(*d)==typeid(ConceptDefImpl) || typeid(*d)==typeid(ConceptDefAliasImpl)))
849 {
850 return static_cast<const ConceptDef*>(d);
851 }
852 else
853 {
854 return nullptr;
855 }
856}

◆ toConceptDef() [2/3]

ConceptDef * toConceptDef ( Definition * d)

Definition at line 821 of file conceptdef.cpp.

822{
823 if (d && (typeid(*d)==typeid(ConceptDefImpl) || typeid(*d)==typeid(ConceptDefAliasImpl)))
824 {
825 return static_cast<ConceptDef*>(d);
826 }
827 else
828 {
829 return nullptr;
830 }
831}

Referenced by NamespaceDefImpl::addInnerCompound(), findModuleDef(), ConceptDefAliasImpl::getCdAlias(), getDefs(), and getTemplateParameterNames().

◆ toConceptDef() [3/3]

ConceptDef * toConceptDef ( DefinitionMutable * md)

Definition at line 833 of file conceptdef.cpp.

834{
835 Definition *d = toDefinition(md);
836 if (d && typeid(*d)==typeid(ConceptDefImpl))
837 {
838 return static_cast<ConceptDef*>(d);
839 }
840 else
841 {
842 return nullptr;
843 }
844}
The common base class of all entity definitions found in the sources.
Definition definition.h:77
Definition * toDefinition(DefinitionMutable *dm)

References toDefinition().

◆ toConceptDefMutable()