Doxygen
Loading...
Searching...
No Matches
ModuleManager Class Reference

#include <src/moduledef.h>

Classes

struct  Private
 

Public Member Functions

void createModuleDef (const QCString &fileName, int line, int column, bool exported, const QCString &moduleName, const QCString &partitionName=QCString())
 
void clear ()
 
void addHeader (const QCString &moduleFile, int line, const QCString &headerName, bool isSystem)
 
void addImport (const QCString &moduleFile, int line, const QCString &importName, bool isExported, const QCString &partitionName=QCString())
 
void addClassToModule (const Entry *root, ClassDef *cd)
 
void addConceptToModule (const Entry *root, ConceptDef *cd)
 
void addMemberToModule (const Entry *root, MemberDef *md)
 
void addDocs (const Entry *root)
 
void addTagInfo (const QCString &moduleFile, const QCString &tagName, const QCString &clangId)
 
void addListReferences ()
 
void addMembersToMemberGroup ()
 
void distributeMemberGroupDocumentation ()
 
void findSectionsInDocumentation ()
 
void sortMemberLists ()
 
void resolvePartitions ()
 
void resolveImports ()
 
void collectExportedSymbols ()
 
void countMembers ()
 
void writeDocumentation (OutputList &ol)
 
int numDocumentedModules () const
 
ModuleLinkedMapmodules ()
 
const ModuleLinkedMapmodules () const
 
ModuleDefgetPrimaryInterface (const QCString &moduleName) const
 

Static Public Member Functions

static ModuleManagerinstance ()
 

Private Member Functions

 ModuleManager ()
 
 ~ModuleManager ()=default
 
void resolvePartitionsRecursively (ModuleDef *intfMod, ModuleDef *mod)
 
void collectExportedSymbolsRecursively (ModuleDef *intfMod, ModuleDef *mod)
 

Private Attributes

std::unique_ptr< Privatep
 

Detailed Description

Definition at line 110 of file moduledef.h.

Constructor & Destructor Documentation

◆ ModuleManager()

ModuleManager::ModuleManager ( )
private

Definition at line 1190 of file moduledef.cpp.

1190 : p(std::make_unique<Private>())
1191{
1192}
std::unique_ptr< Private > p
Definition moduledef.h:147

References p.

Referenced by instance(), and ~ModuleManager().

◆ ~ModuleManager()

ModuleManager::~ModuleManager ( )
privatedefault

References ModuleManager().

Member Function Documentation

◆ addClassToModule()

void ModuleManager::addClassToModule ( const Entry * root,
ClassDef * cd )

Definition at line 1260 of file moduledef.cpp.

1261{
1262 std::lock_guard lock(p->mutex);
1263 auto mod = p->moduleFileMap.find(root->fileName);
1264 if (mod)
1265 {
1266 toModuleDefImpl(mod)->addClassToModule(root,cd);
1267 auto cdm = toClassDefMutable(cd);
1268 if (cdm) cdm->setModuleDef(mod);
1269 }
1270}
QCString fileName
file this entry was extracted from
Definition entry.h:223
void addClassToModule(const Entry *root, ClassDef *cd)
ClassDefMutable * toClassDefMutable(Definition *d)
static ModuleDefImpl * toModuleDefImpl(ModuleDef *m)

References ModuleDefImpl::addClassToModule(), Entry::fileName, p, toClassDefMutable(), and toModuleDefImpl().

Referenced by addClassToContext().

◆ addConceptToModule()

void ModuleManager::addConceptToModule ( const Entry * root,
ConceptDef * cd )

Definition at line 1272 of file moduledef.cpp.

1273{
1274 std::lock_guard lock(p->mutex);
1275 auto mod = p->moduleFileMap.find(root->fileName);
1276 if (mod)
1277 {
1278 toModuleDefImpl(mod)->addConceptToModule(root,cd);
1279 auto cdm = toConceptDefMutable(cd);
1280 if (cdm) cdm->setModuleDef(mod);
1281 }
1282}
void addConceptToModule(const Entry *root, ConceptDef *cd)
ConceptDefMutable * toConceptDefMutable(Definition *d)

References ModuleDefImpl::addConceptToModule(), Entry::fileName, p, toConceptDefMutable(), and toModuleDefImpl().

Referenced by addConceptToContext().

◆ addDocs()

void ModuleManager::addDocs ( const Entry * root)

Definition at line 1520 of file moduledef.cpp.

1521{
1522 AUTO_TRACE("file={} module={}",root->fileName,root->name);
1523 if (root->doc.isEmpty() && root->brief.isEmpty()) return;
1524 if (root->name.find(':')!=-1)
1525 {
1526 warn(root->fileName,root->startLine,"Ignoring documentation for module partition {}. Please place documentation at the primary module name",
1527 root->name);
1528 }
1529 else
1530 {
1531 auto it = p->moduleNameMap.find(root->name.str());
1532 if (it != p->moduleNameMap.end())
1533 {
1534 ModuleDef *mod = getPrimaryInterface(root->name);
1535 if (mod)
1536 {
1537 mod->setDocumentation(root->doc,root->docFile,root->docLine);
1538 mod->setBriefDescription(root->brief,root->briefFile,root->briefLine);
1539 mod->setId(root->id);
1540 mod->setHidden(root->hidden);
1541 mod->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
1542 mod->setRefItems(root->sli);
1543 //mod->addSectionsToDefinition(root->anchors);
1544 addModuleToGroups(root,mod);
1545 }
1546 else
1547 {
1548 warn(root->fileName,root->startLine,"Found documentation for module {} but it has no primary interface unit.",root->name);
1549 }
1550 }
1551 else
1552 {
1553 warn(root->fileName,root->startLine,"Found documentation for unknown module {}.",root->name);
1554 }
1555 }
1556}
virtual void setBodySegment(int defLine, int bls, int ble)=0
virtual void setHidden(bool b)=0
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
virtual void setId(const QCString &name)=0
virtual void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)=0
virtual void setRefItems(const RefItemVector &sli)=0
int docLine
line number at which the documentation was found
Definition entry.h:201
int endBodyLine
line number where the definition ends
Definition entry.h:218
QCString id
libclang id
Definition entry.h:231
int startLine
start line of entry in the source
Definition entry.h:224
QCString name
member name
Definition entry.h:174
QCString briefFile
file in which the brief desc. was found
Definition entry.h:205
int bodyLine
line number of the body in the source
Definition entry.h:216
QCString doc
documentation block (partly parsed)
Definition entry.h:200
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
Definition entry.h:226
QCString docFile
file in which the documentation was found
Definition entry.h:202
bool hidden
does this represent an entity that is hidden from the output
Definition entry.h:228
QCString brief
brief description (doc block)
Definition entry.h:203
int briefLine
line number at which the brief desc. was found
Definition entry.h:204
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:537
#define AUTO_TRACE(...)
Definition docnode.cpp:46
void addModuleToGroups(const Entry *root, ModuleDef *mod)
#define warn(file, line, fmt,...)
Definition message.h:97

References addModuleToGroups(), AUTO_TRACE, Entry::bodyLine, Entry::brief, Entry::briefFile, Entry::briefLine, Entry::doc, Entry::docFile, Entry::docLine, Entry::endBodyLine, Entry::fileName, QCString::find(), getPrimaryInterface(), Entry::hidden, Entry::id, QCString::isEmpty(), Entry::name, p, DefinitionMutable::setBodySegment(), DefinitionMutable::setBriefDescription(), DefinitionMutable::setDocumentation(), DefinitionMutable::setHidden(), DefinitionMutable::setId(), DefinitionMutable::setRefItems(), Entry::sli, Entry::startLine, QCString::str(), and warn.

Referenced by findModuleDocumentation().

◆ addHeader()

void ModuleManager::addHeader ( const QCString & moduleFile,
int line,
const QCString & headerName,
bool isSystem )

Definition at line 1225 of file moduledef.cpp.

1226{
1227 AUTO_TRACE("{}:{} headerName={} isSystem={}",moduleFile,line,headerName,isSystem);
1228 std::lock_guard lock(p->mutex);
1229 auto mod = p->moduleFileMap.find(moduleFile);
1230 if (mod)
1231 {
1232 toModuleDefImpl(mod)->addHeader(line,headerName,isSystem);
1233 }
1234 else
1235 {
1236 AUTO_TRACE_ADD("imported header '{}' found in file '{}' that is not a module",headerName,moduleFile);
1237 }
1238 p->headers.emplace_back(moduleFile,headerName,isSystem);
1239}
void addHeader(int line, const QCString &headerName, bool isSystem)
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:47

References ModuleDefImpl::addHeader(), AUTO_TRACE, AUTO_TRACE_ADD, p, and toModuleDefImpl().

◆ addImport()

void ModuleManager::addImport ( const QCString & moduleFile,
int line,
const QCString & importName,
bool isExported,
const QCString & partitionName = QCString() )

Definition at line 1241 of file moduledef.cpp.

1243{
1244 AUTO_TRACE("{}:{} importName={},isExported={},partitionName={}",
1245 moduleFile,line,importName,isExported,partitionName);
1246 std::lock_guard lock(p->mutex);
1247 auto mod = p->moduleFileMap.find(moduleFile);
1248 if (mod) // import inside a module
1249 {
1250 AUTO_TRACE_ADD("in module");
1251 toModuleDefImpl(mod)->addImport(line,importName.isEmpty()?mod->name():importName,partitionName,isExported);
1252 }
1253 else // import outside of a module
1254 {
1255 AUTO_TRACE_ADD("outside module");
1256 p->externalImports[moduleFile.str()].emplace_back(nullptr,importName,line,partitionName);
1257 }
1258}
void addImport(int line, const QCString &moduleName, const QCString &partitionName, bool isExported)

References ModuleDefImpl::addImport(), AUTO_TRACE, AUTO_TRACE_ADD, QCString::isEmpty(), p, QCString::str(), and toModuleDefImpl().

◆ addListReferences()

void ModuleManager::addListReferences ( )

Definition at line 1574 of file moduledef.cpp.

1575{
1576 for (const auto &mod : p->moduleFileMap) // foreach module
1577 {
1578 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addListReferences();
1579 }
1580}
void addListReferences()

References ModuleDefImpl::addListReferences(), p, and toModuleDefImpl().

Referenced by addListReferences().

◆ addMembersToMemberGroup()

void ModuleManager::addMembersToMemberGroup ( )

Definition at line 1582 of file moduledef.cpp.

1583{
1584 for (const auto &mod : p->moduleFileMap) // foreach module
1585 {
1586 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addMembersToMemberGroup();
1587 }
1588}
void addMembersToMemberGroup()

References ModuleDefImpl::addMembersToMemberGroup(), p, and toModuleDefImpl().

Referenced by addMembersToMemberGroup().

◆ addMemberToModule()

void ModuleManager::addMemberToModule ( const Entry * root,
MemberDef * md )

Definition at line 1284 of file moduledef.cpp.

1285{
1286 std::lock_guard lock(p->mutex);
1287 auto mod = p->moduleFileMap.find(root->fileName);
1288 if (mod && root->exported)
1289 {
1290 toModuleDefImpl(mod)->addMemberToModule(root,md);
1291 auto mdm = toMemberDefMutable(md);
1292 if (mdm) mdm->setModuleDef(mod);
1293 }
1294}
bool exported
is the symbol exported from a C++20 module
Definition entry.h:189
void addMemberToModule(const Entry *root, MemberDef *md)
MemberDefMutable * toMemberDefMutable(Definition *d)

References ModuleDefImpl::addMemberToModule(), Entry::exported, Entry::fileName, p, toMemberDefMutable(), and toModuleDefImpl().

Referenced by addDefineDoc(), addEnumDocs(), addGlobalFunction(), addInterfaceOrServiceToServiceOrSingleton(), addMemberDocs(), addMethodToClass(), addVariableToClass(), addVariableToFile(), buildFunctionList(), findEnums(), and findMember().

◆ addTagInfo()

void ModuleManager::addTagInfo ( const QCString & moduleFile,
const QCString & tagName,
const QCString & clangId )

Definition at line 1296 of file moduledef.cpp.

1297{
1298 std::lock_guard lock(p->mutex);
1299 auto mod = p->moduleFileMap.find(fileName);
1300 if (mod)
1301 {
1302 ModuleDefImpl *modi = toModuleDefImpl(mod);
1303 modi->setReference(tagFile);
1304 modi->setId(clangId);
1305 }
1306}
void setId(const QCString &name) override
void setReference(const QCString &r) override

References p, DefinitionMixin< Base >::setId(), DefinitionMixin< Base >::setReference(), and toModuleDefImpl().

◆ clear()

void ModuleManager::clear ( )

Definition at line 1216 of file moduledef.cpp.

1217{
1218 std::lock_guard lock(p->mutex);
1219 p->headers.clear();
1220 p->externalImports.clear();
1221 p->moduleNameMap.clear();
1222 p->moduleFileMap.clear();
1223}

References p.

Referenced by cleanUpDoxygen().

◆ collectExportedSymbols()

void ModuleManager::collectExportedSymbols ( )

Definition at line 1450 of file moduledef.cpp.

1451{
1452 AUTO_TRACE();
1453 for (auto &mod : p->moduleFileMap) // foreach module
1454 {
1455 if (mod->isPrimaryInterface()) // that is a primary interface
1456 {
1457 for (auto &[partitionName,partitionMod] : mod->partitions())
1458 {
1459 collectExportedSymbolsRecursively(mod.get(),partitionMod);
1460 }
1461
1462 // collect all files that contribute to this module (e.g. implementation/partition modules)
1463 auto it = p->moduleNameMap.find(mod->name().str());
1464 if (it != p->moduleNameMap.end())
1465 {
1466 for (auto contributingMod : it->second)
1467 {
1468 AUTO_TRACE_ADD(" adding contributing module {} to interface module {} type={} partition={} isPrimaryIntf={}",
1469 contributingMod->qualifiedName(),
1470 mod->name(),
1471 contributingMod->moduleType()==ModuleDef::Type::Interface ? "Interface" : "Implementation",
1472 contributingMod->partitionName(),
1473 contributingMod->isPrimaryInterface());
1475 }
1476 }
1477 }
1478 }
1479}
void addContributingModule(ModuleDefImpl *mod)
void collectExportedSymbolsRecursively(ModuleDef *intfMod, ModuleDef *mod)

References ModuleDefImpl::addContributingModule(), AUTO_TRACE, AUTO_TRACE_ADD, collectExportedSymbolsRecursively(), ModuleDef::Interface, p, and toModuleDefImpl().

◆ collectExportedSymbolsRecursively()

void ModuleManager::collectExportedSymbolsRecursively ( ModuleDef * intfMod,
ModuleDef * mod )
private

Definition at line 1442 of file moduledef.cpp.

1443{
1444 AUTO_TRACE("{}: collecting symbols for partition {}",intfMod->qualifiedName(),partitionMod->qualifiedName());
1445 auto intfModImpl = toModuleDefImpl(intfMod);
1446 auto partitionModImpl = toModuleDefImpl(partitionMod);
1447 intfModImpl->mergeSymbolsFrom(partitionModImpl);
1448}
virtual QCString qualifiedName() const =0

References AUTO_TRACE, Definition::qualifiedName(), and toModuleDefImpl().

Referenced by collectExportedSymbols().

◆ countMembers()

void ModuleManager::countMembers ( )

Definition at line 1481 of file moduledef.cpp.

1482{
1483 for (auto &mod : p->moduleFileMap) // foreach module
1484 {
1486 }
1487}
void countMembers()

References ModuleDefImpl::countMembers(), p, and toModuleDefImpl().

◆ createModuleDef()

void ModuleManager::createModuleDef ( const QCString & fileName,
int line,
int column,
bool exported,
const QCString & moduleName,
const QCString & partitionName = QCString() )

Definition at line 1194 of file moduledef.cpp.

1196{
1197 AUTO_TRACE("{}:{}: Found module name='{}' partition='{}' exported='{}'",
1198 fileName,line,moduleName,partitionName,exported);
1199 std::lock_guard lock(p->mutex);
1201 std::unique_ptr<ModuleDef> modDef = std::make_unique<ModuleDefImpl>(fileName,line,column,moduleName,mt,partitionName);
1202 auto mod = p->moduleFileMap.add(fileName,std::move(modDef));
1203 auto it = p->moduleNameMap.find(moduleName.str());
1204 if (it == p->moduleNameMap.end())
1205 {
1206 ModuleList ml;
1207 ml.push_back(mod);
1208 p->moduleNameMap.emplace(moduleName.str(),ml);
1209 }
1210 else
1211 {
1212 it->second.push_back(mod);
1213 }
1214}

References AUTO_TRACE, ModuleDef::Implementation, ModuleDef::Interface, p, and QCString::str().

◆ distributeMemberGroupDocumentation()

void ModuleManager::distributeMemberGroupDocumentation ( )

Definition at line 1590 of file moduledef.cpp.

1591{
1592 for (const auto &mod : p->moduleFileMap) // foreach module
1593 {
1594 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->distributeMemberGroupDocumentation();
1595 }
1596}
void distributeMemberGroupDocumentation()

References ModuleDefImpl::distributeMemberGroupDocumentation(), p, and toModuleDefImpl().

Referenced by distributeMemberGroupDocumentation().

◆ findSectionsInDocumentation()

void ModuleManager::findSectionsInDocumentation ( )

Definition at line 1598 of file moduledef.cpp.

1599{
1600 for (auto &mod : p->moduleFileMap) // foreach module
1601 {
1602 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->findSectionsInDocumentation();
1603 }
1604}
void findSectionsInDocumentation()

References ModuleDefImpl::findSectionsInDocumentation(), p, and toModuleDefImpl().

Referenced by findSectionsInDocumentation().

◆ getPrimaryInterface()

ModuleDef * ModuleManager::getPrimaryInterface ( const QCString & moduleName) const

Definition at line 1558 of file moduledef.cpp.

1559{
1560 auto it = p->moduleNameMap.find(moduleName.str());
1561 if (it != p->moduleNameMap.end())
1562 {
1563 for (const auto &mod : it->second)
1564 {
1565 if (mod->isPrimaryInterface())
1566 {
1567 return mod;
1568 }
1569 }
1570 }
1571 return nullptr;
1572}

References p, and QCString::str().

Referenced by addDocs(), resolveImports(), ModuleDefImpl::writeExports(), writeExports(), and FileDefImpl::writeIncludeFiles().

◆ instance()

◆ modules() [1/2]

ModuleLinkedMap & ModuleManager::modules ( )

Definition at line 1515 of file moduledef.cpp.

1516{
1517 return p->moduleFileMap;
1518}

References p.

◆ modules() [2/2]

const ModuleLinkedMap & ModuleManager::modules ( ) const

Definition at line 1510 of file moduledef.cpp.

1511{
1512 return p->moduleFileMap;
1513}

References p.

◆ numDocumentedModules()

int ModuleManager::numDocumentedModules ( ) const

Definition at line 1500 of file moduledef.cpp.

1501{
1502 int count=0;
1503 for (const auto &mod : p->moduleFileMap) // foreach module
1504 {
1505 if (mod->isPrimaryInterface()) count++;
1506 }
1507 return count;
1508}

References p.

Referenced by Index::countDataStructures().

◆ resolveImports()

void ModuleManager::resolveImports ( )

Definition at line 1383 of file moduledef.cpp.

1384{
1385 AUTO_TRACE();
1386 for (auto &mod : p->moduleFileMap)
1387 {
1388 FileDef *fd = mod->getFileDef();
1389 if (fd)
1390 {
1391 for (const auto &[fileName,importInfoList] : mod->getImports())
1392 {
1393 for (const auto &importInfo : importInfoList)
1394 {
1395 ModuleDef *importedModule = getPrimaryInterface(importInfo.importName);
1396 const FileDef *importedFd = importedModule ? importedModule->getFileDef() : nullptr;
1397 AUTO_TRACE_ADD("module: addIncludeDependency {}->{}:{} fd={}",
1398 mod->qualifiedName(), importInfo.qualifiedName(), importInfo.line, fd?fd->absFilePath():"");
1399 fd->addIncludeDependency(importedFd,importInfo.qualifiedName(),IncludeKind::ImportModule);
1400 }
1401 }
1402 }
1403 }
1404 for (const auto &[fileName,importInfoList] : p->externalImports)
1405 {
1406 for (const auto &importInfo : importInfoList)
1407 {
1408 bool ambig = false;
1409 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,QCString(fileName),ambig);
1410 AUTO_TRACE_ADD("externalImport name={} fd={}",fileName,(void*)fd);
1411 if (fd)
1412 {
1413 ModuleDef *mod = getPrimaryInterface(importInfo.importName);
1414 FileDef *importedFd = mod ? mod->getFileDef() : nullptr;
1415 fd->addIncludeDependency(importedFd,importInfo.importName,IncludeKind::ImportModule);
1416 if (importedFd)
1417 {
1418 importedFd->addIncludedByDependency(fd,stripFromPath(QCString(fileName)),IncludeKind::ImportModule);
1419 }
1420 }
1421 }
1422 }
1423 for (const auto &headerInfo : p->headers)
1424 {
1425 bool ambig = false;
1426 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,headerInfo.fileName,ambig);
1427 AUTO_TRACE_ADD("header name={} fd={}",headerInfo.fileName,(void*)fd);
1428 if (fd)
1429 {
1430 QCString resolvedHeader = determineAbsoluteIncludeName(headerInfo.fileName,headerInfo.headerName);
1431 FileDef *importFd = findFileDef(Doxygen::inputNameLinkedMap,resolvedHeader,ambig);
1432 fd->addIncludeDependency(importFd, headerInfo.headerName,
1433 headerInfo.isSystem ? IncludeKind::ImportSystem : IncludeKind::ImportLocal);
1434 if (importFd)
1435 {
1436 importFd->addIncludedByDependency(fd,headerInfo.fileName,IncludeKind::ImportModule);
1437 }
1438 }
1439 }
1440}
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:105
virtual void addIncludedByDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual QCString absFilePath() const =0
virtual void addIncludeDependency(const FileDef *fd, const QCString &incName, IncludeKind kind)=0
virtual FileDef * getFileDef() const =0
@ ImportLocal
Definition filedef.h:54
@ ImportModule
Definition filedef.h:55
@ ImportSystem
Definition filedef.h:53
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:309
QCString determineAbsoluteIncludeName(const QCString &curFile, const QCString &incFileName)
Definition util.cpp:4040
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3348

References FileDef::absFilePath(), FileDef::addIncludedByDependency(), FileDef::addIncludeDependency(), AUTO_TRACE, AUTO_TRACE_ADD, determineAbsoluteIncludeName(), FileDef::fileName(), findFileDef(), ModuleDef::getFileDef(), getPrimaryInterface(), ImportLocal, ImportModule, ImportSystem, Doxygen::inputNameLinkedMap, p, Definition::qualifiedName(), and stripFromPath().

◆ resolvePartitions()

void ModuleManager::resolvePartitions ( )

Definition at line 1350 of file moduledef.cpp.

1351{
1352 AUTO_TRACE();
1353 for (auto &mod : p->moduleFileMap) // foreach module
1354 {
1355 if (mod->moduleType()==ModuleDef::Type::Interface && mod->partitionName().isEmpty())
1356 { // that is a primary interface
1357 resolvePartitionsRecursively(mod.get(),mod.get());
1358 }
1359
1360 // copy exported imports to m_exportedModules
1361 for (const auto &[fileName,importInfoList] : mod->getImports())
1362 {
1363 for (const auto &importInfo : importInfoList)
1364 {
1365 if (importInfo.exported && mod->name()!=importInfo.importName)
1366 {
1367 toModuleDefImpl(mod)->addExportedModule(importInfo.importName,importInfo);
1368 }
1369 }
1370 }
1371
1372 // also link the ModuleDef and FileDef together
1373 bool ambig = false;
1374 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,mod->getDefFileName(),ambig);
1375 if (fd)
1376 {
1377 fd->setModuleDef(mod.get());
1378 toModuleDefImpl(mod)->setFileDef(fd);
1379 }
1380 }
1381}
virtual void setModuleDef(ModuleDef *mod)=0
void addExportedModule(const QCString &moduleName, const ImportInfo &info)
void setFileDef(FileDef *fd)
void resolvePartitionsRecursively(ModuleDef *intfMod, ModuleDef *mod)

References ModuleDefImpl::addExportedModule(), AUTO_TRACE, findFileDef(), Doxygen::inputNameLinkedMap, ModuleDef::Interface, p, resolvePartitionsRecursively(), ModuleDefImpl::setFileDef(), FileDef::setModuleDef(), and toModuleDefImpl().

◆ resolvePartitionsRecursively()

void ModuleManager::resolvePartitionsRecursively ( ModuleDef * intfMod,
ModuleDef * mod )
private

Definition at line 1308 of file moduledef.cpp.

1309{
1310 AUTO_TRACE();
1311 for (auto &[partitionFileName,importInfoList] : mod->getImports()) // foreach import
1312 {
1313 for (auto &importInfo : importInfoList)
1314 {
1315 AUTO_TRACE_ADD("partitionFileName={} importName={} partitionName={}",
1316 partitionFileName,importInfo.importName,importInfo.partitionName);
1317 if (importInfo.importName==intfMod->name() && !importInfo.partitionName.isEmpty() &&
1318 importInfo.exported) // that is an exported partition of this module
1319 {
1320 auto it = p->moduleNameMap.find(importInfo.importName.str());
1321 if (it != p->moduleNameMap.end())
1322 {
1323 for (auto importedMod : it->second)
1324 {
1325 if (importedMod->qualifiedName()==importInfo.importName+":"+importInfo.partitionName)
1326 {
1327 AUTO_TRACE_ADD("Interface module {} exports partition {}:{}",
1328 mod->name(),importedMod->name(),importedMod->partitionName());
1329 toModuleDefImpl(intfMod)->addPartition(toModuleDefImpl(importedMod));
1330 toModuleDefImpl(importedMod)->setPrimaryInterface(intfMod);
1331 for (const auto &[partitionFileName_,partitionImportInfoList] : importedMod->getImports())
1332 {
1333 for (const auto &partitionImportInfo : partitionImportInfoList)
1334 {
1335 if (partitionImportInfo.exported && intfMod->name()!=partitionImportInfo.importName)
1336 {
1337 toModuleDefImpl(intfMod)->addExportedModule(partitionImportInfo.importName,partitionImportInfo);
1338 }
1339 }
1340 }
1341 resolvePartitionsRecursively(intfMod,importedMod);
1342 }
1343 }
1344 }
1345 }
1346 }
1347 }
1348}
virtual const QCString & name() const =0
virtual const ImportInfoMap & getImports() const =0
void addPartition(ModuleDefImpl *mod)
void setPrimaryInterface(const ModuleDef *mod)

References ModuleDefImpl::addExportedModule(), ModuleDefImpl::addPartition(), AUTO_TRACE, AUTO_TRACE_ADD, ModuleDef::getImports(), QCString::isEmpty(), Definition::name(), p, resolvePartitionsRecursively(), ModuleDefImpl::setPrimaryInterface(), and toModuleDefImpl().

Referenced by resolvePartitions(), and resolvePartitionsRecursively().

◆ sortMemberLists()

void ModuleManager::sortMemberLists ( )

Definition at line 1606 of file moduledef.cpp.

1607{
1608 for (auto &mod : p->moduleFileMap) // foreach module
1609 {
1610 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->sortMemberLists();
1611 }
1612}
void sortMemberLists()

References p, ModuleDefImpl::sortMemberLists(), and toModuleDefImpl().

Referenced by sortMemberLists().

◆ writeDocumentation()

void ModuleManager::writeDocumentation ( OutputList & ol)

Definition at line 1489 of file moduledef.cpp.

1490{
1491 for (auto &mod : p->moduleFileMap) // foreach module
1492 {
1493 if (mod->isPrimaryInterface())
1494 {
1495 mod->writeDocumentation(ol);
1496 }
1497 }
1498}

References p.

Referenced by generateOutput().

Member Data Documentation

◆ p


The documentation for this class was generated from the following files: