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
 
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 1186 of file moduledef.cpp.

1186 : p(std::make_unique<Private>())
1187{
1188}
std::unique_ptr< Private > p
Definition moduledef.h:146

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 1256 of file moduledef.cpp.

1257{
1258 std::lock_guard lock(p->mutex);
1259 auto mod = p->moduleFileMap.find(root->fileName);
1260 if (mod)
1261 {
1262 toModuleDefImpl(mod)->addClassToModule(root,cd);
1263 auto cdm = toClassDefMutable(cd);
1264 if (cdm) cdm->setModuleDef(mod);
1265 }
1266}
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 1268 of file moduledef.cpp.

1269{
1270 std::lock_guard lock(p->mutex);
1271 auto mod = p->moduleFileMap.find(root->fileName);
1272 if (mod)
1273 {
1274 toModuleDefImpl(mod)->addConceptToModule(root,cd);
1275 auto cdm = toConceptDefMutable(cd);
1276 if (cdm) cdm->setModuleDef(mod);
1277 }
1278}
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 1511 of file moduledef.cpp.

1512{
1513 AUTO_TRACE("file={} module={}",root->fileName,root->name);
1514 if (root->doc.isEmpty() && root->brief.isEmpty()) return;
1515 if (root->name.find(':')!=-1)
1516 {
1517 warn(root->fileName,root->startLine,"Ignoring documentation for module partition %s. Please place documentation at the primary module name",
1518 qPrint(root->name));
1519 }
1520 else
1521 {
1522 auto it = p->moduleNameMap.find(root->name.str());
1523 if (it != p->moduleNameMap.end())
1524 {
1525 ModuleDef *mod = getPrimaryInterface(root->name);
1526 if (mod)
1527 {
1528 mod->setDocumentation(root->doc,root->docFile,root->docLine);
1529 mod->setBriefDescription(root->brief,root->briefFile,root->briefLine);
1530 mod->setId(root->id);
1531 mod->setHidden(root->hidden);
1532 mod->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
1533 mod->setRefItems(root->sli);
1534 //mod->addSectionsToDefinition(root->anchors);
1535 addModuleToGroups(root,mod);
1536 }
1537 else
1538 {
1539 warn(root->fileName,root->startLine,"Found documentation for module %s but it has no primary interface unit.",qPrint(root->name));
1540 }
1541 }
1542 else
1543 {
1544 warn(root->fileName,root->startLine,"Found documentation for unknown module %s.",qPrint(root->name));
1545 }
1546 }
1547}
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:59
const char * qPrint(const char *s)
Definition qcstring.h:672

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, qPrint(), 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 1221 of file moduledef.cpp.

1222{
1223 AUTO_TRACE("{}:{} headerName={} isSystem={}",moduleFile,line,headerName,isSystem);
1224 std::lock_guard lock(p->mutex);
1225 auto mod = p->moduleFileMap.find(moduleFile);
1226 if (mod)
1227 {
1228 toModuleDefImpl(mod)->addHeader(line,headerName,isSystem);
1229 }
1230 else
1231 {
1232 AUTO_TRACE_ADD("imported header '{}' found in file '{}' that is not a module",headerName,moduleFile);
1233 }
1234 p->headers.emplace_back(moduleFile,headerName,isSystem);
1235}
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 1237 of file moduledef.cpp.

1239{
1240 AUTO_TRACE("{}:{} importName={},isExported={},partitionName={}",
1241 moduleFile,line,importName,isExported,partitionName);
1242 std::lock_guard lock(p->mutex);
1243 auto mod = p->moduleFileMap.find(moduleFile);
1244 if (mod) // import inside a module
1245 {
1246 AUTO_TRACE_ADD("in module");
1247 toModuleDefImpl(mod)->addImport(line,importName.isEmpty()?mod->name():importName,partitionName,isExported);
1248 }
1249 else // import outside of a module
1250 {
1251 AUTO_TRACE_ADD("outside module");
1252 p->externalImports[moduleFile.str()].emplace_back(nullptr,importName,line,partitionName);
1253 }
1254}
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 1565 of file moduledef.cpp.

1566{
1567 for (const auto &mod : p->moduleFileMap) // foreach module
1568 {
1569 if (mod->isPrimaryInterface()) toModuleDefImpl(mod)->addListReferences();
1570 }
1571}
void addListReferences()

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

Referenced by addListReferences().

◆ addMembersToMemberGroup()

void ModuleManager::addMembersToMemberGroup ( )

Definition at line 1573 of file moduledef.cpp.

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

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

Referenced by addMembersToMemberGroup().

◆ addMemberToModule()

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

Definition at line 1280 of file moduledef.cpp.

1281{
1282 std::lock_guard lock(p->mutex);
1283 auto mod = p->moduleFileMap.find(root->fileName);
1284 if (mod && root->exported)
1285 {
1286 toModuleDefImpl(mod)->addMemberToModule(root,md);
1287 auto mdm = toMemberDefMutable(md);
1288 if (mdm) mdm->setModuleDef(mod);
1289 }
1290}
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 1292 of file moduledef.cpp.

1293{
1294 std::lock_guard lock(p->mutex);
1295 auto mod = p->moduleFileMap.find(fileName);
1296 if (mod)
1297 {
1298 ModuleDefImpl *modi = toModuleDefImpl(mod);
1299 modi->setReference(tagFile);
1300 modi->setId(clangId);
1301 }
1302}
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 1212 of file moduledef.cpp.

1213{
1214 std::lock_guard lock(p->mutex);
1215 p->headers.clear();
1216 p->externalImports.clear();
1217 p->moduleNameMap.clear();
1218 p->moduleFileMap.clear();
1219}

References p.

Referenced by cleanUpDoxygen().

◆ collectExportedSymbols()

void ModuleManager::collectExportedSymbols ( )

Definition at line 1446 of file moduledef.cpp.

1447{
1448 AUTO_TRACE();
1449 for (auto &mod : p->moduleFileMap) // foreach module
1450 {
1451 if (mod->isPrimaryInterface()) // that is a primary interface
1452 {
1453 for (auto &[partitionName,partitionMod] : mod->partitions())
1454 {
1455 collectExportedSymbolsRecursively(mod.get(),partitionMod);
1456 }
1457
1458 // collect all files that contribute to this module (e.g. implementation/partition modules)
1459 auto it = p->moduleNameMap.find(mod->name().str());
1460 if (it != p->moduleNameMap.end())
1461 {
1462 for (auto contributingMod : it->second)
1463 {
1464 AUTO_TRACE_ADD(" adding contributing module {} to interface module {} type={} partition={} isPrimaryIntf={}",
1465 contributingMod->qualifiedName(),
1466 mod->name(),
1467 contributingMod->moduleType()==ModuleDef::Type::Interface ? "Interface" : "Implementation",
1468 contributingMod->partitionName(),
1469 contributingMod->isPrimaryInterface());
1471 }
1472 }
1473 }
1474 }
1475}
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 1438 of file moduledef.cpp.

1439{
1440 AUTO_TRACE("{}: collecting symbols for partition {}",intfMod->qualifiedName(),partitionMod->qualifiedName());
1441 auto intfModImpl = toModuleDefImpl(intfMod);
1442 auto partitionModImpl = toModuleDefImpl(partitionMod);
1443 intfModImpl->mergeSymbolsFrom(partitionModImpl);
1444}
virtual QCString qualifiedName() const =0

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

Referenced by collectExportedSymbols().

◆ countMembers()

void ModuleManager::countMembers ( )

Definition at line 1477 of file moduledef.cpp.

1478{
1479 for (auto &mod : p->moduleFileMap) // foreach module
1480 {
1482 }
1483}
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 1190 of file moduledef.cpp.

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

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

◆ distributeMemberGroupDocumentation()

void ModuleManager::distributeMemberGroupDocumentation ( )

Definition at line 1581 of file moduledef.cpp.

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

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

Referenced by distributeMemberGroupDocumentation().

◆ findSectionsInDocumentation()

void ModuleManager::findSectionsInDocumentation ( )

Definition at line 1589 of file moduledef.cpp.

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

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

Referenced by findSectionsInDocumentation().

◆ getPrimaryInterface()

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

Definition at line 1549 of file moduledef.cpp.

1550{
1551 auto it = p->moduleNameMap.find(moduleName.str());
1552 if (it != p->moduleNameMap.end())
1553 {
1554 for (const auto &mod : it->second)
1555 {
1556 if (mod->isPrimaryInterface())
1557 {
1558 return mod;
1559 }
1560 }
1561 }
1562 return nullptr;
1563}

References p, and QCString::str().

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

◆ instance()

◆ modules()

const ModuleLinkedMap & ModuleManager::modules ( ) const

Definition at line 1506 of file moduledef.cpp.

1507{
1508 return p->moduleFileMap;
1509}

References p.

◆ numDocumentedModules()

int ModuleManager::numDocumentedModules ( ) const

Definition at line 1496 of file moduledef.cpp.

1497{
1498 int count=0;
1499 for (const auto &mod : p->moduleFileMap) // foreach module
1500 {
1501 if (mod->isPrimaryInterface()) count++;
1502 }
1503 return count;
1504}

References p.

Referenced by Index::countDataStructures().

◆ resolveImports()

void ModuleManager::resolveImports ( )

Definition at line 1379 of file moduledef.cpp.

1380{
1381 AUTO_TRACE();
1382 for (auto &mod : p->moduleFileMap)
1383 {
1384 FileDef *fd = mod->getFileDef();
1385 if (fd)
1386 {
1387 for (const auto &[fileName,importInfoList] : mod->getImports())
1388 {
1389 for (const auto &importInfo : importInfoList)
1390 {
1391 ModuleDef *importedModule = getPrimaryInterface(importInfo.importName);
1392 const FileDef *importedFd = importedModule ? importedModule->getFileDef() : nullptr;
1393 AUTO_TRACE_ADD("module: addIncludeDependency {}->{}:{} fd={}",
1394 mod->qualifiedName(), importInfo.qualifiedName(), importInfo.line, fd?fd->absFilePath():"");
1395 fd->addIncludeDependency(importedFd,importInfo.qualifiedName(),IncludeKind::ImportModule);
1396 }
1397 }
1398 }
1399 }
1400 for (const auto &[fileName,importInfoList] : p->externalImports)
1401 {
1402 for (const auto &importInfo : importInfoList)
1403 {
1404 bool ambig = false;
1405 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,QCString(fileName),ambig);
1406 AUTO_TRACE_ADD("externalImport name={} fd={}",fileName,(void*)fd);
1407 if (fd)
1408 {
1409 ModuleDef *mod = getPrimaryInterface(importInfo.importName);
1410 FileDef *importedFd = mod ? mod->getFileDef() : nullptr;
1411 fd->addIncludeDependency(importedFd,importInfo.importName,IncludeKind::ImportModule);
1412 if (importedFd)
1413 {
1414 importedFd->addIncludedByDependency(fd,stripFromPath(QCString(fileName)),IncludeKind::ImportModule);
1415 }
1416 }
1417 }
1418 }
1419 for (const auto &headerInfo : p->headers)
1420 {
1421 bool ambig = false;
1422 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,headerInfo.fileName,ambig);
1423 AUTO_TRACE_ADD("header name={} fd={}",headerInfo.fileName,(void*)fd);
1424 if (fd)
1425 {
1426 QCString resolvedHeader = determineAbsoluteIncludeName(headerInfo.fileName,headerInfo.headerName);
1427 FileDef *importFd = findFileDef(Doxygen::inputNameLinkedMap,resolvedHeader,ambig);
1428 fd->addIncludeDependency(importFd, headerInfo.headerName,
1429 headerInfo.isSystem ? IncludeKind::ImportSystem : IncludeKind::ImportLocal);
1430 if (importFd)
1431 {
1432 importFd->addIncludedByDependency(fd,headerInfo.fileName,IncludeKind::ImportModule);
1433 }
1434 }
1435 }
1436}
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:3954
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:3262

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 1346 of file moduledef.cpp.

1347{
1348 AUTO_TRACE();
1349 for (auto &mod : p->moduleFileMap) // foreach module
1350 {
1351 if (mod->moduleType()==ModuleDef::Type::Interface && mod->partitionName().isEmpty())
1352 { // that is a primary interface
1353 resolvePartitionsRecursively(mod.get(),mod.get());
1354 }
1355
1356 // copy exported imports to m_exportedModules
1357 for (const auto &[fileName,importInfoList] : mod->getImports())
1358 {
1359 for (const auto &importInfo : importInfoList)
1360 {
1361 if (importInfo.exported && mod->name()!=importInfo.importName)
1362 {
1363 toModuleDefImpl(mod)->addExportedModule(importInfo.importName,importInfo);
1364 }
1365 }
1366 }
1367
1368 // also link the ModuleDef and FileDef together
1369 bool ambig = false;
1370 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,mod->getDefFileName(),ambig);
1371 if (fd)
1372 {
1373 fd->setModuleDef(mod.get());
1374 toModuleDefImpl(mod)->setFileDef(fd);
1375 }
1376 }
1377}
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 1304 of file moduledef.cpp.

1305{
1306 AUTO_TRACE();
1307 for (auto &[partitionFileName,importInfoList] : mod->getImports()) // foreach import
1308 {
1309 for (auto &importInfo : importInfoList)
1310 {
1311 AUTO_TRACE_ADD("partitionFileName={} importName={} partitionName={}",
1312 partitionFileName,importInfo.importName,importInfo.partitionName);
1313 if (importInfo.importName==intfMod->name() && !importInfo.partitionName.isEmpty() &&
1314 importInfo.exported) // that is an exported partition of this module
1315 {
1316 auto it = p->moduleNameMap.find(importInfo.importName.str());
1317 if (it != p->moduleNameMap.end())
1318 {
1319 for (auto importedMod : it->second)
1320 {
1321 if (importedMod->qualifiedName()==importInfo.importName+":"+importInfo.partitionName)
1322 {
1323 AUTO_TRACE_ADD("Interface module {} exports partition {}:{}",
1324 mod->name(),importedMod->name(),importedMod->partitionName());
1325 toModuleDefImpl(intfMod)->addPartition(toModuleDefImpl(importedMod));
1326 toModuleDefImpl(importedMod)->setPrimaryInterface(intfMod);
1327 for (const auto &[partitionFileName_,partitionImportInfoList] : importedMod->getImports())
1328 {
1329 for (const auto &partitionImportInfo : partitionImportInfoList)
1330 {
1331 if (partitionImportInfo.exported && intfMod->name()!=partitionImportInfo.importName)
1332 {
1333 toModuleDefImpl(intfMod)->addExportedModule(partitionImportInfo.importName,partitionImportInfo);
1334 }
1335 }
1336 }
1337 resolvePartitionsRecursively(intfMod,importedMod);
1338 }
1339 }
1340 }
1341 }
1342 }
1343 }
1344}
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 1597 of file moduledef.cpp.

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

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

Referenced by sortMemberLists().

◆ writeDocumentation()

void ModuleManager::writeDocumentation ( OutputList & ol)

Definition at line 1485 of file moduledef.cpp.

1486{
1487 for (auto &mod : p->moduleFileMap) // foreach module
1488 {
1489 if (mod->isPrimaryInterface())
1490 {
1491 mod->writeDocumentation(ol);
1492 }
1493 }
1494}

References p.

Referenced by generateOutput().

Member Data Documentation

◆ p


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