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 870 of file conceptdef.cpp.

871{
872 if (n.empty()) return nullptr;
874}
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 876 of file conceptdef.cpp.

877{
878 ConceptDef *cd=nullptr;
879 while (d && d!=Doxygen::globalScope)
880 {
881 cd = getConcept(d->name()+"::"+name);
882 if (cd) return cd;
883 d = d->getOuterScope();
884 }
885 cd = getConcept(name);
886 return cd;
887}
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 844 of file conceptdef.cpp.

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

◆ toConceptDef() [2/3]

ConceptDef * toConceptDef ( Definition * d)

Definition at line 819 of file conceptdef.cpp.

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

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

◆ toConceptDef() [3/3]

ConceptDef * toConceptDef ( DefinitionMutable * md)

Definition at line 831 of file conceptdef.cpp.

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

References toDefinition().

◆ toConceptDefMutable()