Doxygen
memberdef.h 文件参考
#include <vector>
#include <memory>
#include <sys/types.h>
#include "types.h"
#include "definition.h"
#include "arguments.h"
#include "classdef.h"
+ memberdef.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

class  MemberDef
 A model of a class/file/namespace member symbol. 更多...
 
class  MemberDefMutable
 

函数

MemberDeftoMemberDef (Definition *d)
 
MemberDeftoMemberDef (DefinitionMutable *d)
 
const MemberDeftoMemberDef (const Definition *d)
 
MemberDefMutabletoMemberDefMutable (Definition *d)
 
MemberDefMutabletoMemberDefMutable (const Definition *d)
 
MemberDefMutablecreateMemberDef (const QCString &defFileName, int defLine, int defColumn, const QCString &type, const QCString &name, const QCString &args, const QCString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const QCString &metaData)
 Factory method to create a new instance of a MemberDef 更多...
 
MemberDefcreateMemberDefAlias (const Definition *newScope, const MemberDef *aliasMd)
 
void combineDeclarationAndDefinition (MemberDefMutable *mdec, MemberDefMutable *mdef)
 
void addDocCrossReference (MemberDefMutable *src, MemberDefMutable *dst)
 

函数说明

◆ addDocCrossReference()

void addDocCrossReference ( MemberDefMutable src,
MemberDefMutable dst 
)

在文件 memberdef.cpp6047 行定义.

6048 {
6049  if (src==0 || dst==0) return;
6050  //printf("--> addDocCrossReference src=%s,dst=%s\n",qPrint(src->name()),qPrint(dst->name()));
6051  if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
6052  if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) &&
6053  src->showInCallGraph()
6054  )
6055  {
6056  dst->addSourceReferencedBy(src);
6058  if (mdDef)
6059  {
6060  mdDef->addSourceReferencedBy(src);
6061  }
6063  if (mdDecl)
6064  {
6065  mdDecl->addSourceReferencedBy(src);
6066  }
6067  }
6068  if ((src->hasReferencesRelation() || src->hasCallGraph()) &&
6069  src->showInCallGraph()
6070  )
6071  {
6072  src->addSourceReferences(dst);
6074  if (mdDef)
6075  {
6076  mdDef->addSourceReferences(dst);
6077  }
6079  if (mdDecl)
6080  {
6081  mdDecl->addSourceReferences(dst);
6082  }
6083  }
6084 }

引用了 DefinitionMutable::addSourceReferencedBy(), DefinitionMutable::addSourceReferences(), MemberDef::hasCallerGraph(), MemberDef::hasCallGraph(), MemberDef::hasReferencedByRelation(), MemberDef::hasReferencesRelation(), MemberDef::isEnumerate(), MemberDef::isTypedef(), MemberDef::memberDeclaration(), MemberDef::memberDefinition(), MemberDef::showInCallGraph() , 以及 toMemberDefMutable().

◆ combineDeclarationAndDefinition()

void combineDeclarationAndDefinition ( MemberDefMutable mdec,
MemberDefMutable mdef 
)

在文件 memberdef.cpp5818 行定义.

5819 {
5820  //printf("mdec=%s isPrototype()=%d\n",qPrint(mdec->name()),mdec->isPrototype());
5821  if (
5822  (mdef->isFunction() && !mdef->isStatic() && !mdef->isPrototype()) ||
5823  (mdef->isVariable() && !mdef->isExternal() && !mdef->isStatic())
5824  )
5825  {
5826  //printf("mdef=(%p,%s) mdec=(%p,%s)\n",
5827  // mdef, mdef ? qPrint(mdef->name()) : "",
5828  // mdec, mdec ? qPrint(mdec->name()) : "");
5829 
5830  ArgumentList &mdefAl = const_cast<ArgumentList&>(mdef->argumentList());
5831  ArgumentList &mdecAl = const_cast<ArgumentList&>(mdec->argumentList());
5832  if (matchArguments2(mdef->getOuterScope(),mdef->getFileDef(),&mdefAl,
5833  mdec->getOuterScope(),mdec->getFileDef(),&mdecAl,
5834  TRUE
5835  )
5836  ) /* match found */
5837  {
5838  //printf("Found member %s: definition in %s (doc='%s') and declaration in %s (doc='%s')\n",
5839  // mn->memberName(),
5840  // qPrint(mdef->getFileDef()->name()),qPrint(mdef->documentation()),
5841  // qPrint(mdec->getFileDef()->name()),qPrint(mdec->documentation())
5842  // );
5843 
5844  if (Config_getBool(RESOLVE_UNNAMED_PARAMS))
5845  {
5846  mdec->resolveUnnamedParameters(mdef);
5847  }
5848 
5849  // first merge argument documentation
5850  transferArgumentDocumentation(mdecAl,mdefAl);
5851 
5852  /* copy documentation between function definition and declaration */
5853  if (!mdec->briefDescription().isEmpty())
5854  {
5855  mdef->setBriefDescription(mdec->briefDescription(),mdec->briefFile(),mdec->briefLine());
5856  }
5857  else if (!mdef->briefDescription().isEmpty())
5858  {
5859  mdec->setBriefDescription(mdef->briefDescription(),mdef->briefFile(),mdef->briefLine());
5860  }
5861  if (!mdef->documentation().isEmpty())
5862  {
5863  //printf("transferring docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
5864  mdec->setDocumentation(mdef->documentation(),mdef->docFile(),mdef->docLine());
5866  if (mdefAl.hasParameters())
5867  {
5868  auto mdefAlComb = stringToArgumentList(mdef->getLanguage(),mdef->argsString());
5869  transferArgumentDocumentation(mdefAl,*mdefAlComb);
5870  mdec->moveArgumentList(std::move(mdefAlComb));
5871  }
5872  }
5873  else if (!mdec->documentation().isEmpty())
5874  {
5875  //printf("transferring docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
5876  mdef->setDocumentation(mdec->documentation(),mdec->docFile(),mdec->docLine());
5878  if (mdecAl.hasParameters())
5879  {
5880  auto mdecAlComb = stringToArgumentList(mdec->getLanguage(),mdec->argsString());
5881  transferArgumentDocumentation(mdecAl,*mdecAlComb);
5882  mdef->moveDeclArgumentList(std::move(mdecAlComb));
5883  }
5884  }
5885  if (!mdef->inbodyDocumentation().isEmpty())
5886  {
5887  mdec->setInbodyDocumentation(mdef->inbodyDocumentation(),mdef->inbodyFile(),mdef->inbodyLine());
5888  }
5889  else if (!mdec->inbodyDocumentation().isEmpty())
5890  {
5891  mdef->setInbodyDocumentation(mdec->inbodyDocumentation(),mdec->inbodyFile(),mdec->inbodyLine());
5892  }
5893  if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
5894  {
5895  //printf("body mdec->mdef %d-%d\n",mdec->getStartBodyLine(),mdef->getEndBodyLine());
5896  mdef->setBodySegment(mdec->getDefLine(),mdec->getStartBodyLine(),mdec->getEndBodyLine());
5897  mdef->setBodyDef(mdec->getBodyDef());
5898  //mdef->setBodyMember(mdec);
5899  }
5900  else if (mdef->getStartBodyLine()!=-1 && mdec->getStartBodyLine()==-1)
5901  {
5902  //printf("body mdef->mdec %d-%d\n",mdef->getStartBodyLine(),mdec->getEndBodyLine());
5903  mdec->setBodySegment(mdef->getDefLine(),mdef->getStartBodyLine(),mdef->getEndBodyLine());
5904  mdec->setBodyDef(mdef->getBodyDef());
5905  //mdec->setBodyMember(mdef);
5906  }
5909 
5910  // copy group info.
5911  if (mdec->getGroupDef()==0 && mdef->getGroupDef()!=0)
5912  {
5913  mdec->setGroupDef(mdef->getGroupDef(),
5914  mdef->getGroupPri(),
5915  mdef->docFile(),
5916  mdef->docLine(),
5917  mdef->hasDocumentation(),
5918  mdef
5919  );
5920  }
5921  else if (mdef->getGroupDef()==0 && mdec->getGroupDef()!=0)
5922  {
5923  mdef->setGroupDef(mdec->getGroupDef(),
5924  mdec->getGroupPri(),
5925  mdec->docFile(),
5926  mdec->docLine(),
5927  mdec->hasDocumentation(),
5928  mdec
5929  );
5930  }
5931 
5932 
5933  mdec->mergeRefItems(mdef);
5934  mdef->mergeRefItems(mdec);
5935 
5936  mdef->setMemberDeclaration(mdec);
5937  mdec->setMemberDefinition(mdef);
5938 
5939  mdef->enableCallGraph(mdec->hasCallGraph() || mdef->hasCallGraph());
5940  mdef->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph());
5941  mdec->enableCallGraph(mdec->hasCallGraph() || mdef->hasCallGraph());
5942  mdec->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph());
5943 
5948  }
5949  }
5950 }

引用了 MemberDef::argsString(), MemberDef::argumentList(), MemberDef::briefDescription(), Definition::briefFile(), Definition::briefLine(), Config_getBool, Definition::docFile(), Definition::docLine(), MemberDef::documentation(), MemberDefMutable::enableCallerGraph(), MemberDefMutable::enableCallGraph(), MemberDefMutable::enableReferencedByRelation(), MemberDefMutable::enableReferencesRelation(), Definition::getBodyDef(), Definition::getDefLine(), Definition::getEndBodyLine(), MemberDef::getFileDef(), MemberDef::getGroupDef(), MemberDef::getGroupPri(), Definition::getLanguage(), MemberDef::getMemberSpecifiers(), Definition::getOuterScope(), Definition::getStartBodyLine(), MemberDef::hasCallerGraph(), MemberDef::hasCallGraph(), MemberDef::hasDocumentation(), ArgumentList::hasParameters(), MemberDef::hasReferencedByRelation(), MemberDef::hasReferencesRelation(), Definition::inbodyDocumentation(), Definition::inbodyFile(), Definition::inbodyLine(), MemberDef::isDocsForDefinition(), QCString::isEmpty(), MemberDef::isExternal(), MemberDef::isFunction(), MemberDef::isPrototype(), MemberDef::isStatic(), MemberDef::isVariable(), matchArguments2(), MemberDefMutable::mergeMemberSpecifiers(), DefinitionMutable::mergeRefItems(), MemberDefMutable::moveArgumentList(), MemberDefMutable::moveDeclArgumentList(), MemberDefMutable::resolveUnnamedParameters(), DefinitionMutable::setBodyDef(), DefinitionMutable::setBodySegment(), MemberDefMutable::setBriefDescription(), MemberDefMutable::setDocsForDefinition(), MemberDefMutable::setDocumentation(), MemberDefMutable::setGroupDef(), MemberDefMutable::setInbodyDocumentation(), MemberDefMutable::setMemberDeclaration(), MemberDefMutable::setMemberDefinition(), stringToArgumentList(), transferArgumentDocumentation() , 以及 TRUE.

被这些函数引用 ClassDefImpl::mergeCategory() , 以及 transferFunctionDocumentation().

◆ createMemberDef()

MemberDefMutable* createMemberDef ( const QCString defFileName,
int  defLine,
int  defColumn,
const QCString type,
const QCString name,
const QCString args,
const QCString excp,
Protection  prot,
Specifier  virt,
bool  stat,
Relationship  related,
MemberType  t,
const ArgumentList tal,
const ArgumentList al,
const QCString metaData 
)

Factory method to create a new instance of a MemberDef

在文件 memberdef.cpp373 行定义.

378 {
379  return new MemberDefImpl(defFileName,defLine,defColumn,type,name,args,excp,prot,virt,
380  stat,related,t,tal,al,metaData);
381 }

被这些函数引用 addEnumValuesToEnums(), addInstance(), addLocalObjCMethod(), addMemberSpecialization(), addOverloaded(), addVariableToClass(), addVariableToFile(), buildDefineList(), createTagLessInstance(), MemberDefImpl::createTemplateInstanceMember(), findDefineDocumentation(), findEnums(), findMember() , 以及 findUsingDeclImports().

◆ createMemberDefAlias()

MemberDef* createMemberDefAlias ( const Definition newScope,
const MemberDef aliasMd 
)

在文件 memberdef.cpp781 行定义.

782 {
783  MemberDef *amd = new MemberDefAliasImpl(newScope,aliasMd);
784  //printf("amd: name=%s displayName=%s\n",qPrint(amd->name()),qPrint(amd->displayName()));
785  return amd;
786 }

被这些函数引用 MemberDefAliasImpl::deepCopy() , 以及 NamespaceDefImpl::insertMember().

◆ toMemberDef() [1/3]

const MemberDef* toMemberDef ( const Definition d)

在文件 memberdef.cpp6113 行定义.

6114 {
6115  if (d && (typeid(*d)==typeid(MemberDefImpl) || typeid(*d)==typeid(MemberDefAliasImpl)))
6116  {
6117  return static_cast<const MemberDef*>(d);
6118  }
6119  else
6120  {
6121  return 0;
6122  }
6123 }

◆ toMemberDef() [2/3]

◆ toMemberDef() [3/3]

MemberDef* toMemberDef ( DefinitionMutable d)

在文件 memberdef.cpp6100 行定义.

6101 {
6102  Definition *d = toDefinition(md);
6103  if (d && typeid(*d)==typeid(MemberDefImpl))
6104  {
6105  return static_cast<MemberDef*>(d);
6106  }
6107  else
6108  {
6109  return 0;
6110  }
6111 }

引用了 toDefinition().

◆ toMemberDefMutable() [1/2]

MemberDefMutable* toMemberDefMutable ( const Definition d)

在文件 memberdef.cpp6137 行定义.

6138 {
6139  if (d && typeid(*d)==typeid(MemberDefImpl))
6140  {
6141  return const_cast<MemberDefMutable*>(static_cast<const MemberDefMutable*>(d));
6142  }
6143  else
6144  {
6145  return 0;
6146  }
6147 }

◆ toMemberDefMutable() [2/2]

MemberDefMutable* toMemberDefMutable ( Definition d)

在文件 memberdef.cpp6125 行定义.

6126 {
6127  if (d && typeid(*d)==typeid(MemberDefImpl))
6128  {
6129  return static_cast<MemberDefMutable*>(d);
6130  }
6131  else
6132  {
6133  return 0;
6134  }
6135 }

被这些函数引用 addDocCrossReference(), addEnumValuesToEnums(), MemberList::addListReferences(), addMemberFunction(), addMembersToMemberGroup(), addMemberToGroups(), NamespaceDefImpl::addMemberToList(), FileDefImpl::addMemberToList(), ClassDefImpl::addMemberToList(), addVariableToClass(), addVariableToFile(), computeMemberRelations(), MemberGroup::distributeMemberGroupDocumentation(), findDefineDocumentation(), findDEV(), findEnumDocumentation(), findGlobalMember(), findMember(), MemberList::findSectionsInDocumentation(), flushCachedTemplateRelations(), flushUnresolvedRelations(), inheritDocumentation(), MemberGroup::insertMember(), NamespaceDefImpl::insertMember(), GroupDefImpl::insertMember(), MemberDefImpl::insertReimplementedBy(), ClassDefImpl::mergeCategory(), SymbolResolver::Private::newResolveTypedef(), processTagLessClasses(), MemberList::setAnchors(), MemberList::setAnonymousEnumType(), ClassDefImpl::setGroupDefForAllMembers(), transferFunctionDocumentation(), transferFunctionReferences(), transferRelatedFunctionDocumentation(), vhdlCorrectMemberProperties(), MemberDefImpl::writeDeclaration(), MemberList::writeDocumentation(), MemberList::writeDocumentationPage(), MemberDefImpl::writeEnumDeclaration(), MemberList::writePlainDeclarations(), VhdlDocGen::writePlainVHDLDeclarations(), MemberList::writeSimpleDocumentation() , 以及 MemberList::writeTagFile().

toDefinition
Definition * toDefinition(DefinitionMutable *dm)
Definition: definition.cpp:1950
DefinitionMutable::addSourceReferences
virtual void addSourceReferences(const MemberDef *d)=0
MemberDef::isTypedef
virtual bool isTypedef() const =0
Definition::docLine
virtual int docLine() const =0
MemberDefMutable::mergeMemberSpecifiers
virtual void mergeMemberSpecifiers(uint64 s)=0
toMemberDefMutable
MemberDefMutable * toMemberDefMutable(Definition *d)
Definition: memberdef.cpp:6125
MemberDef::hasReferencedByRelation
virtual bool hasReferencedByRelation() const =0
MemberDef::argsString
virtual QCString argsString() const =0
MemberDef::briefDescription
virtual QCString briefDescription(bool abbr=FALSE) const =0
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
MemberDef::documentation
virtual QCString documentation() const =0
MemberDef::isStatic
virtual bool isStatic() const =0
MemberDef::getGroupPri
virtual Grouping::GroupPri_t getGroupPri() const =0
DefinitionMutable::mergeRefItems
virtual void mergeRefItems(Definition *d)=0
ArgumentList
This class represents an function or template argument list.
Definition: arguments.h:59
Definition::getDefLine
virtual int getDefLine() const =0
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
MemberDef::isPrototype
virtual bool isPrototype() const =0
Definition::inbodyLine
virtual int inbodyLine() const =0
MemberDefMutable::setDocsForDefinition
virtual void setDocsForDefinition(bool b)=0
Definition::briefLine
virtual int briefLine() const =0
MemberDefMutable::setBriefDescription
virtual void setBriefDescription(const QCString &b, const QCString &briefFile, int briefLine)=0
MemberDefMutable
Definition: memberdef.h:296
transferArgumentDocumentation
static void transferArgumentDocumentation(ArgumentList &decAl, ArgumentList &defAl)
Definition: memberdef.cpp:5788
Definition::docFile
virtual QCString docFile() const =0
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
MemberDef::showInCallGraph
virtual bool showInCallGraph() const =0
ArgumentList::hasParameters
bool hasParameters() const
Definition: arguments.h:69
DefinitionMutable::setBodyDef
virtual void setBodyDef(const FileDef *fd)=0
MemberDefImpl
Definition: memberdef.cpp:51
Definition::getBodyDef
virtual const FileDef * getBodyDef() const =0
MemberDef::memberDeclaration
virtual MemberDef * memberDeclaration() const =0
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
MemberDef::hasCallerGraph
virtual bool hasCallerGraph() const =0
MemberDefMutable::setMemberDefinition
virtual void setMemberDefinition(MemberDef *md)=0
MemberDef::isVariable
virtual bool isVariable() const =0
Definition::inbodyDocumentation
virtual QCString inbodyDocumentation() const =0
MemberDefMutable::setMemberDeclaration
virtual void setMemberDeclaration(MemberDef *md)=0
Definition::inbodyFile
virtual QCString inbodyFile() const =0
MemberDefMutable::setInbodyDocumentation
virtual void setInbodyDocumentation(const QCString &d, const QCString &inbodyFile, int inbodyLine)=0
MemberDef::hasDocumentation
virtual bool hasDocumentation() const =0
MemberDefMutable::enableReferencesRelation
virtual void enableReferencesRelation(bool e)=0
MemberDef::isFunction
virtual bool isFunction() const =0
MemberDefMutable::setGroupDef
virtual void setGroupDef(const GroupDef *gd, Grouping::GroupPri_t pri, const QCString &fileName, int startLine, bool hasDocs, MemberDef *member=0)=0
TRUE
#define TRUE
Definition: qcstring.h:36
Definition::getStartBodyLine
virtual int getStartBodyLine() const =0
Definition::getEndBodyLine
virtual int getEndBodyLine() const =0
MemberDef::memberDefinition
virtual MemberDef * memberDefinition() const =0
Definition::briefFile
virtual QCString briefFile() const =0
DefinitionMutable::addSourceReferencedBy
virtual void addSourceReferencedBy(const MemberDef *d)=0
MemberDef::getMemberSpecifiers
virtual uint64 getMemberSpecifiers() const =0
MemberDefMutable::enableReferencedByRelation
virtual void enableReferencedByRelation(bool e)=0
MemberDefMutable::enableCallGraph
virtual void enableCallGraph(bool e)=0
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
MemberDefMutable::moveDeclArgumentList
virtual void moveDeclArgumentList(std::unique_ptr< ArgumentList > al)=0
MemberDefAliasImpl
Definition: memberdef.cpp:385
MemberDef::isDocsForDefinition
virtual bool isDocsForDefinition() const =0
MemberDefMutable::setDocumentation
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
MemberDef::isEnumerate
virtual bool isEnumerate() const =0
MemberDef::isExternal
virtual bool isExternal() const =0
Definition::getOuterScope
virtual Definition * getOuterScope() const =0
MemberDef::getFileDef
virtual const FileDef * getFileDef() const =0
DefinitionMutable::setBodySegment
virtual void setBodySegment(int defLine, int bls, int ble)=0
MemberDef::hasCallGraph
virtual bool hasCallGraph() const =0
MemberDef::argumentList
virtual const ArgumentList & argumentList() const =0
MemberDefMutable::resolveUnnamedParameters
virtual void resolveUnnamedParameters(const MemberDef *md)=0
MemberDefMutable::moveArgumentList
virtual void moveArgumentList(std::unique_ptr< ArgumentList > al)=0
MemberDef::hasReferencesRelation
virtual bool hasReferencesRelation() const =0
MemberDefMutable::enableCallerGraph
virtual void enableCallerGraph(bool e)=0
stringToArgumentList
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
matchArguments2
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV)
Definition: util.cpp:1919
MemberDef::getGroupDef
virtual const GroupDef * getGroupDef() const =0