diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-05 17:53:20 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-11-09 18:47:45 (GMT) |
commit | 075229e586b391c3ec7ad79597aaeae392ca64e5 (patch) | |
tree | 2ad99929371727ad0811a55e597fa81a70ba43a7 /src/membergroup.cpp | |
parent | 6922d5d63d77c8f640c58e9c68a9955f9f0aa9a7 (diff) | |
download | Doxygen-075229e586b391c3ec7ad79597aaeae392ca64e5.zip Doxygen-075229e586b391c3ec7ad79597aaeae392ca64e5.tar.gz Doxygen-075229e586b391c3ec7ad79597aaeae392ca64e5.tar.bz2 |
Refactoring: Introduce immutable and mutable interfaces
Split Definition/ClassDef/NamespaceDef/MemberDef into a immutable and mutable part
Aliases are immutable, other symbols are stored using an immutable
interface but can be made mutable explicitly by dynamic casting.
Diffstat (limited to 'src/membergroup.cpp')
-rw-r--r-- | src/membergroup.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/membergroup.cpp b/src/membergroup.cpp index e229835..b47fe71 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -71,10 +71,14 @@ void MemberGroup::insertMember(MemberDef *md) GroupDef *gd; if (firstMd && !firstMd->isAlias() && (gd=const_cast<GroupDef*>(firstMd->getGroupDef()))) { - md->setGroupDef(gd, firstMd->getGroupPri(), - firstMd->getGroupFileName(), - firstMd->getGroupStartLine(), - firstMd->getGroupHasDocs()); + MemberDefMutable *mdm = MemberDef::make_mutable(md); + if (mdm) + { + mdm->setGroupDef(gd, firstMd->getGroupPri(), + firstMd->getGroupFileName(), + firstMd->getGroupStartLine(), + firstMd->getGroupHasDocs()); + } gd->insertMember(md); } } @@ -112,7 +116,7 @@ void MemberGroup::writeDocumentation(OutputList &ol,const char *scopeName, } void MemberGroup::writeDocumentationPage(OutputList &ol,const char *scopeName, - const Definition *container) const + const DefinitionMutable *container) const { memberList->writeDocumentationPage(ol,scopeName,container); } @@ -217,12 +221,13 @@ void MemberGroup::distributeMemberGroupDocumentation() if (md) // distribute docs of md to other members of the list { //printf("Member %s has documentation!\n",md->name().data()); - MemberDef *omd; - for (li.toFirst();(omd=li.current());++li) + MemberDef *iomd; + for (li.toFirst();(iomd=li.current());++li) { - if (md!=omd && omd->documentation().isEmpty() && - omd->briefDescription().isEmpty() && - omd->inbodyDocumentation().isEmpty() + MemberDefMutable *omd = MemberDef::make_mutable(iomd); + if (omd && md!=omd && omd->documentation().isEmpty() && + omd->briefDescription().isEmpty() && + omd->inbodyDocumentation().isEmpty() ) { //printf("Copying documentation to member %s\n",omd->name().data()); |