Classes | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
NestingNodeContext::Private Class Reference

Classes

struct  Cachable
 

Public Member Functions

 Private (const NestingNodeContext *parent, const NestingNodeContext *thisNode, Definition *d, int index, int level, bool addCls, bool inherit, bool hideSuper)
 
TemplateVariant get (const char *n) const
 
TemplateVariant isLeafNode () const
 
TemplateVariant children () const
 
TemplateVariant getClass () const
 
TemplateVariant getNamespace () const
 
TemplateVariant getDir () const
 
TemplateVariant getFile () const
 
TemplateVariant getPage () const
 
TemplateVariant getModule () const
 
TemplateVariant level () const
 
TemplateVariant id () const
 
TemplateVariant name () const
 
QCString relPathAsString () const
 
TemplateVariant brief () const
 
TemplateVariant isLinkable () const
 
TemplateVariant anchor () const
 
TemplateVariant fileName () const
 
TemplateVariant isReference () const
 
TemplateVariant externalReference () const
 
void addClasses (bool inherit, bool hideSuper)
 
void addNamespaces (bool addClasses)
 
void addDirFiles ()
 
void addPages ()
 
void addModules ()
 

Private Attributes

const NestingNodeContextm_parent
 
Definitionm_def
 
SharedPtr< NestingContextm_children
 
int m_level
 
int m_index
 
Cachable m_cache
 

Static Private Attributes

static PropertyMapper< NestingNodeContext::Privates_inst
 

Detailed Description

Definition at line 6061 of file context.cpp.

Constructor & Destructor Documentation

NestingNodeContext::Private::Private ( const NestingNodeContext parent,
const NestingNodeContext thisNode,
Definition d,
int  index,
int  level,
bool  addCls,
bool  inherit,
bool  hideSuper 
)
inline

Definition at line 6064 of file context.cpp.

6066  : m_parent(parent), m_def(d), m_level(level), m_index(index)
6067  {
6069  static bool init=FALSE;
6070  if (!init)
6071  {
6072  //%% bool is_leaf_node: true if this node does not have any children
6073  s_inst.addProperty("is_leaf_node",&Private::isLeafNode);
6074  //%% Nesting children: list of nested classes/namespaces
6075  s_inst.addProperty("children",&Private::children);
6076  //%% [optional] Class class: class info (if this node represents a class)
6077  s_inst.addProperty("class",&Private::getClass);
6078  //%% [optional] Namespace namespace: namespace info (if this node represents a namespace)
6079  s_inst.addProperty("namespace",&Private::getNamespace);
6080  //%% [optional] File file: file info (if this node represents a file)
6081  s_inst.addProperty("file",&Private::getFile);
6082  //%% [optional] Dir dir: directory info (if this node represents a directory)
6083  s_inst.addProperty("dir",&Private::getDir);
6084  //%% [optional] Page page: page info (if this node represents a page)
6085  s_inst.addProperty("page",&Private::getPage);
6086  //%% [optional] Module module: module info (if this node represents a module)
6087  s_inst.addProperty("module",&Private::getModule);
6088  //%% int id
6089  s_inst.addProperty("id",&Private::id);
6090  //%% string level
6091  s_inst.addProperty("level",&Private::level);
6092  //%% string name
6093  s_inst.addProperty("name",&Private::name);
6094  //%% string brief
6095  s_inst.addProperty("brief",&Private::brief);
6096  //%% bool isLinkable
6097  s_inst.addProperty("isLinkable",&Private::isLinkable);
6098  s_inst.addProperty("anchor",&Private::anchor);
6099  s_inst.addProperty("fileName",&Private::fileName);
6100  s_inst.addProperty("isReference",&Private::isReference);
6101  s_inst.addProperty("externalReference",&Private::externalReference);
6102  init=TRUE;
6103  }
6104 
6105  addNamespaces(addCls);
6106  addClasses(inherit,hideSuper);
6107  addDirFiles();
6108  addPages();
6109  addModules();
6110  }
TemplateVariant isReference() const
Definition: context.cpp:6261
TemplateVariant getModule() const
Definition: context.cpp:6198
static NestingContext * alloc(const NestingNodeContext *parent, int level)
Definition: context.h:536
const NestingNodeContext * m_parent
Definition: context.cpp:6341
void addClasses(bool inherit, bool hideSuper)
Definition: context.cpp:6272
const bool FALSE
Definition: qglobal.h:370
TemplateVariant brief() const
Definition: context.cpp:6233
TemplateVariant getClass() const
Definition: context.cpp:6123
TemplateVariant name() const
Definition: context.cpp:6224
init
Definition: train.py:42
static PropertyMapper< NestingNodeContext::Private > s_inst
Definition: context.cpp:6357
TemplateVariant anchor() const
Definition: context.cpp:6253
TemplateVariant id() const
Definition: context.cpp:6217
TemplateVariant getNamespace() const
Definition: context.cpp:6138
TemplateVariant fileName() const
Definition: context.cpp:6257
TemplateVariant isLinkable() const
Definition: context.cpp:6249
TemplateVariant getDir() const
Definition: context.cpp:6153
TemplateVariant level() const
Definition: context.cpp:6213
void reset(T *p=0)
Definition: context.cpp:113
TemplateVariant externalReference() const
Definition: context.cpp:6265
TemplateVariant getFile() const
Definition: context.cpp:6168
TemplateVariant children() const
Definition: context.cpp:6119
TemplateVariant getPage() const
Definition: context.cpp:6183
void addNamespaces(bool addClasses)
Definition: context.cpp:6300
TemplateVariant isLeafNode() const
Definition: context.cpp:6115
const bool TRUE
Definition: qglobal.h:371
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343

Member Function Documentation

void NestingNodeContext::Private::addClasses ( bool  inherit,
bool  hideSuper 
)
inline

Definition at line 6272 of file context.cpp.

6273  {
6275  if (cd && inherit)
6276  {
6277  bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd);
6278  if (hasChildren)
6279  {
6280  bool wasVisited=cd->visited;
6281  cd->visited=TRUE;
6282  if (cd->getLanguage()==SrcLangExt_VHDL)
6283  {
6284  m_children->addDerivedClasses(cd->baseClasses(),wasVisited);
6285  }
6286  else
6287  {
6288  m_children->addDerivedClasses(cd->subClasses(),wasVisited);
6289  }
6290  }
6291  }
6292  else
6293  {
6294  if (cd && cd->getClassSDict())
6295  {
6297  }
6298  }
6299  }
BaseClassList * subClasses() const
Definition: classdef.cpp:4404
const bool FALSE
Definition: qglobal.h:370
ClassSDict * getClassSDict()
Definition: classdef.cpp:4389
virtual DefType definitionType() const =0
SrcLangExt getLanguage() const
void addDerivedClasses(const BaseClassList *bcl, bool hideSuper)
Definition: context.cpp:6683
bool classHasVisibleChildren(ClassDef *cd)
Definition: util.cpp:5182
bool visited
Definition: classdef.h:402
void addClasses(const ClassSDict &clDict, bool rootOnly)
Definition: context.cpp:6633
const bool TRUE
Definition: qglobal.h:371
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
BaseClassList * baseClasses() const
Definition: classdef.cpp:4399
void NestingNodeContext::Private::addDirFiles ( )
inline

Definition at line 6312 of file context.cpp.

6313  {
6315  if (dd)
6316  {
6317  m_children->addDirs(dd->subDirs());
6318  if (dd && dd->getFiles())
6319  {
6320  m_children->addFiles(*dd->getFiles());
6321  }
6322  }
6323  }
void addDirs(const DirSDict &)
Definition: context.cpp:6643
virtual DefType definitionType() const =0
const DirList & subDirs() const
Definition: dirdef.h:61
Definition: dirdef.h:44
FileList * getFiles() const
Definition: dirdef.h:59
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
void addFiles(const FileNameList &)
Definition: context.cpp:6653
void NestingNodeContext::Private::addModules ( )
inline

Definition at line 6332 of file context.cpp.

6333  {
6335  if (gd && gd->getSubGroups())
6336  {
6338  }
6339  }
void addModules(const GroupSDict &modules)
Definition: context.cpp:6668
GroupList * getSubGroups() const
Definition: groupdef.h:103
virtual DefType definitionType() const =0
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
void NestingNodeContext::Private::addNamespaces ( bool  addClasses)
inline

Definition at line 6300 of file context.cpp.

6301  {
6303  if (nd && nd->getNamespaceSDict())
6304  {
6306  }
6307  if (addClasses && nd && nd->getClassSDict())
6308  {
6310  }
6311  }
void addNamespaces(const NamespaceSDict &nsDict, bool rootOnly, bool addClasses)
Definition: context.cpp:6638
void addClasses(bool inherit, bool hideSuper)
Definition: context.cpp:6272
const bool FALSE
Definition: qglobal.h:370
virtual DefType definitionType() const =0
NamespaceSDict * getNamespaceSDict() const
Definition: namespacedef.h:101
void addClasses(const ClassSDict &clDict, bool rootOnly)
Definition: context.cpp:6633
ClassSDict * getClassSDict() const
Definition: namespacedef.h:98
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
void NestingNodeContext::Private::addPages ( )
inline

Definition at line 6324 of file context.cpp.

6325  {
6327  if (pd && pd->getSubPages())
6328  {
6330  }
6331  }
PageSDict * getSubPages() const
Definition: pagedef.h:56
const bool FALSE
Definition: qglobal.h:370
void addPages(const PageSDict &pages, bool rootOnly)
Definition: context.cpp:6663
virtual DefType definitionType() const =0
A model of a page symbol.
Definition: pagedef.h:29
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
TemplateVariant NestingNodeContext::Private::anchor ( ) const
inline

Definition at line 6253 of file context.cpp.

6254  {
6255  return m_def->anchor();
6256  }
virtual QCString anchor() const =0
TemplateVariant NestingNodeContext::Private::brief ( ) const
inline

Definition at line 6233 of file context.cpp.

6234  {
6235  if (!m_cache.brief)
6236  {
6237  if (m_def->hasBriefDescription())
6238  {
6240  "",m_def->briefDescription(),TRUE)));
6241  }
6242  else
6243  {
6245  }
6246  }
6247  return *m_cache.brief;
6248  }
void reset(T *p=0)
Definition: context.cpp:92
int briefLine() const
static TemplateVariant parseDoc(Definition *def, const QCString &file, int line, const QCString &relPath, const QCString &docStr, bool isBrief)
Definition: context.cpp:1227
bool hasBriefDescription() const
QCString briefFile() const
virtual QCString briefDescription(bool abbreviate=FALSE) const
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
ScopedPtr< TemplateVariant > brief
Definition: context.cpp:6354
const bool TRUE
Definition: qglobal.h:371
TemplateVariant NestingNodeContext::Private::children ( ) const
inline

Definition at line 6119 of file context.cpp.

6120  {
6121  return m_children.get();
6122  }
T * get() const
Definition: context.cpp:111
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
TemplateVariant NestingNodeContext::Private::externalReference ( ) const
inline

Definition at line 6265 of file context.cpp.

6266  {
6268  }
QCString relPathAsString() const
Definition: context.cpp:6228
QCString externalReference(const QCString &relPath) const
TemplateVariant NestingNodeContext::Private::fileName ( ) const
inline

Definition at line 6257 of file context.cpp.

6258  {
6259  return m_def->getOutputFileBase();
6260  }
virtual QCString getOutputFileBase() const =0
TemplateVariant NestingNodeContext::Private::get ( const char *  n) const
inline

Definition at line 6111 of file context.cpp.

6112  {
6113  return s_inst.get(this,n);
6114  }
static PropertyMapper< NestingNodeContext::Private > s_inst
Definition: context.cpp:6357
std::void_t< T > n
TemplateVariant NestingNodeContext::Private::getClass ( ) const
inline

Definition at line 6123 of file context.cpp.

6124  {
6126  {
6128  }
6129  if (m_cache.classContext)
6130  {
6131  return m_cache.classContext.get();
6132  }
6133  else
6134  {
6135  return TemplateVariant(FALSE);
6136  }
6137  }
const bool FALSE
Definition: qglobal.h:370
virtual DefType definitionType() const =0
void reset(T *p=0)
Definition: context.cpp:113
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
SharedPtr< ClassContext > classContext
Definition: context.cpp:6348
T * get() const
Definition: context.cpp:111
static ClassContext * alloc(ClassDef *cd)
Definition: context.h:256
TemplateVariant NestingNodeContext::Private::getDir ( ) const
inline

Definition at line 6153 of file context.cpp.

6154  {
6156  {
6158  }
6159  if (m_cache.dirContext)
6160  {
6161  return m_cache.dirContext.get();
6162  }
6163  else
6164  {
6165  return TemplateVariant(FALSE);
6166  }
6167  }
const bool FALSE
Definition: qglobal.h:370
static DirContext * alloc(DirDef *dd)
Definition: context.h:312
virtual DefType definitionType() const =0
Definition: dirdef.h:44
void reset(T *p=0)
Definition: context.cpp:113
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
SharedPtr< DirContext > dirContext
Definition: context.cpp:6350
T * get() const
Definition: context.cpp:111
TemplateVariant NestingNodeContext::Private::getFile ( ) const
inline

Definition at line 6168 of file context.cpp.

6169  {
6171  {
6173  }
6174  if (m_cache.fileContext)
6175  {
6176  return m_cache.fileContext.get();
6177  }
6178  else
6179  {
6180  return TemplateVariant(FALSE);
6181  }
6182  }
static FileContext * alloc(FileDef *fd)
Definition: context.h:294
const bool FALSE
Definition: qglobal.h:370
SharedPtr< FileContext > fileContext
Definition: context.cpp:6351
virtual DefType definitionType() const =0
void reset(T *p=0)
Definition: context.cpp:113
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
T * get() const
Definition: context.cpp:111
TemplateVariant NestingNodeContext::Private::getModule ( ) const
inline

Definition at line 6198 of file context.cpp.

6199  {
6201  {
6203  }
6204  if (m_cache.moduleContext)
6205  {
6206  return m_cache.moduleContext.get();
6207  }
6208  else
6209  {
6210  return TemplateVariant(FALSE);
6211  }
6212  }
const bool FALSE
Definition: qglobal.h:370
virtual DefType definitionType() const =0
void reset(T *p=0)
Definition: context.cpp:113
static ModuleContext * alloc(GroupDef *gd)
Definition: context.h:371
SharedPtr< ModuleContext > moduleContext
Definition: context.cpp:6353
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
T * get() const
Definition: context.cpp:111
TemplateVariant NestingNodeContext::Private::getNamespace ( ) const
inline

Definition at line 6138 of file context.cpp.

6139  {
6141  {
6143  }
6145  {
6146  return m_cache.namespaceContext.get();
6147  }
6148  else
6149  {
6150  return TemplateVariant(FALSE);
6151  }
6152  }
static NamespaceContext * alloc(NamespaceDef *nd)
Definition: context.h:275
const bool FALSE
Definition: qglobal.h:370
SharedPtr< NamespaceContext > namespaceContext
Definition: context.cpp:6349
virtual DefType definitionType() const =0
void reset(T *p=0)
Definition: context.cpp:113
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
T * get() const
Definition: context.cpp:111
TemplateVariant NestingNodeContext::Private::getPage ( ) const
inline

Definition at line 6183 of file context.cpp.

6184  {
6186  {
6188  }
6189  if (m_cache.pageContext)
6190  {
6191  return m_cache.pageContext.get();
6192  }
6193  else
6194  {
6195  return TemplateVariant(FALSE);
6196  }
6197  }
static PageContext * alloc(PageDef *pd, bool isMainPage, bool isExample)
Definition: context.h:332
const bool FALSE
Definition: qglobal.h:370
virtual DefType definitionType() const =0
SharedPtr< PageContext > pageContext
Definition: context.cpp:6352
void reset(T *p=0)
Definition: context.cpp:113
Variant type which can hold one value of a fixed set of types.
Definition: template.h:90
A model of a page symbol.
Definition: pagedef.h:29
T * get() const
Definition: context.cpp:111
TemplateVariant NestingNodeContext::Private::id ( ) const
inline

Definition at line 6217 of file context.cpp.

6218  {
6219  QCString result;
6220  if (m_parent) result=m_parent->id();
6221  result+=QCString().setNum(m_index)+"_";
6222  return result;
6223  }
static QCString result
const NestingNodeContext * m_parent
Definition: context.cpp:6341
QCString id() const
Definition: context.cpp:6380
QCString & setNum(short n)
Definition: qcstring.cpp:469
TemplateVariant NestingNodeContext::Private::isLeafNode ( ) const
inline

Definition at line 6115 of file context.cpp.

6116  {
6117  return m_children->count()==0;
6118  }
virtual int count() const
Definition: context.cpp:6618
SharedPtr< NestingContext > m_children
Definition: context.cpp:6343
TemplateVariant NestingNodeContext::Private::isLinkable ( ) const
inline

Definition at line 6249 of file context.cpp.

6250  {
6251  return m_def->isLinkable();
6252  }
virtual bool isLinkable() const =0
TemplateVariant NestingNodeContext::Private::isReference ( ) const
inline

Definition at line 6261 of file context.cpp.

6262  {
6263  return m_def->isReference();
6264  }
virtual bool isReference() const
TemplateVariant NestingNodeContext::Private::level ( ) const
inline

Definition at line 6213 of file context.cpp.

6214  {
6215  return m_level;
6216  }
TemplateVariant NestingNodeContext::Private::name ( ) const
inline

Definition at line 6224 of file context.cpp.

6225  {
6226  return m_def->displayName(FALSE);
6227  }
const bool FALSE
Definition: qglobal.h:370
virtual QCString displayName(bool includeScope=TRUE) const =0
QCString NestingNodeContext::Private::relPathAsString ( ) const
inline

Definition at line 6228 of file context.cpp.

6229  {
6230  static bool createSubdirs = Config_getBool("CREATE_SUBDIRS");
6231  return createSubdirs ? QCString("../../") : QCString("");
6232  }
#define Config_getBool(val)
Definition: config.cpp:664

Member Data Documentation

Cachable NestingNodeContext::Private::m_cache
mutableprivate

Definition at line 6356 of file context.cpp.

SharedPtr<NestingContext> NestingNodeContext::Private::m_children
private

Definition at line 6343 of file context.cpp.

Definition* NestingNodeContext::Private::m_def
private

Definition at line 6342 of file context.cpp.

int NestingNodeContext::Private::m_index
private

Definition at line 6345 of file context.cpp.

int NestingNodeContext::Private::m_level
private

Definition at line 6344 of file context.cpp.

const NestingNodeContext* NestingNodeContext::Private::m_parent
private

Definition at line 6341 of file context.cpp.

PropertyMapper< NestingNodeContext::Private > NestingNodeContext::Private::s_inst
staticprivate

Definition at line 6357 of file context.cpp.


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