ProjectNode Class Reference

Class for representing one (Sg)Project in the GUI. More...

#include <Project.h>

Inheritance diagram for ProjectNode:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ProjectNode (const QString &name)
 Creates a ProjectNode with an empty SgProject.
virtual ~ProjectNode ()
bool addFile (const QString &path)
void addBinaryFile (const QList< SourceFileNode * > &sourceFileNode)
 Adds a binary file by compiling an existing source-file.
QStringList getCommandLine () const
void addToCommandLine (const QString &string)
void setCommandLine (const QStringList &l)
void showCmdLineDialog ()
 Shows a dialog where the use can edit the rose frontend options.
SgProject * getSgProject ()
MetricsConfiggetMetricsConfig ()
int getSourceFileCount () const
SourceFileNodegetSourceFile (int id) const
int getBinaryFileCount () const
BinaryFileNodegetBinaryFile (int id) const
SgIncidenceDirectedGraph * getCallGraph ()
 TODO update graph when files are added.
virtual QVariant data (int role, int column=0) const
const QString & getName () const
virtual ItemTreeNodegetParent () const
virtual Qt::ItemFlags flags (int column) const
virtual ItemTreeNodechild (int id)
virtual int childrenCount () const
virtual int getChildId (ItemTreeNode *child)
virtual int addChild (ItemTreeNode *c)
 Add child, notifies model if setNotifiyModel was called.
virtual void addChildAt (ItemTreeNode *c, int id)
 Adds child at a specified position, id: id>=0 and id<=childrenCount.
virtual void addChildren (const QList< ItemTreeNode * > &list)
 Adds a list of children.
virtual void removeAllChildren ()
 Removes all children and deletes them.
void takeAllChildren (QList< ItemTreeNode * > &output)
virtual void removeChild (int id)
 Removes child, notifies model if setNotifiyModel was called.
virtual int getRow () const
virtual QStringList sectionHeader () const
 List of Column-Header Captions.
virtual bool isFirstColumnSpanned () const
 If true the item spanns all columns in a row.
virtual void setNotifyModel (ItemTreeModel *m)
template<typename LessThan>
void sortChildren (LessThan compareFunction)
template<typename LessThan>
void sortChildrenStable (LessThan compareFunction)

Protected Member Functions

void createSrcFileHeaderNode ()
void createBinFileHeaderNode ()

Protected Attributes

QString name
SgProject * sgProject
MetricsConfigmetricsConfig
SgIncidenceDirectedGraph * callGraph
SourceFileHeaderNodesrcFileHeaderNode
BinaryFileHeaderNodebinFileHeaderNode
ItemTreeNodeparent
QList< ItemTreeNode * > children
ItemTreeModelnotifyModel

Detailed Description

Class for representing one (Sg)Project in the GUI.

Used for displaying the node which represents a project in the ProjectView, but has also functionality for adding and removing files from a SgProject

Definition at line 115 of file Project.h.


Constructor & Destructor Documentation

ProjectNode::ProjectNode ( const QString &  name  ) 

Creates a ProjectNode with an empty SgProject.

Definition at line 212 of file Project.cpp.

ProjectNode::~ProjectNode (  )  [virtual]

Definition at line 251 of file Project.cpp.


Member Function Documentation

void ProjectNode::addBinaryFile ( const QList< SourceFileNode * > &  sourceFileNode  ) 

Adds a binary file by compiling an existing source-file.

Definition at line 314 of file Project.cpp.

int ItemTreeNode::addChild ( ItemTreeNode c  )  [virtual, inherited]

Add child, notifies model if setNotifiyModel was called.

Definition at line 17 of file ItemTreeNode.cpp.

Referenced by QtAstModel::ModelNode::addChild(), PropertyTreeModel::addEntry(), PropertyTreeModel::addEntryToSection(), addFile(), ProjectManager::addProject(), PropertyTreeModel::addSection(), buildAsmTreeDiff(), buildAsmTreeVisit(), BAstNode::generate(), BAstNode::generationVisit(), and ProjectManager::loadProjectState().

Here is the call graph for this function:

Here is the caller graph for this function:

void ItemTreeNode::addChildAt ( ItemTreeNode c,
int  id 
) [virtual, inherited]

Adds child at a specified position, id: id>=0 and id<=childrenCount.

Definition at line 24 of file ItemTreeNode.cpp.

Referenced by ItemTreeNode::addChild(), createBinFileHeaderNode(), and createSrcFileHeaderNode().

Here is the call graph for this function:

Here is the caller graph for this function:

void ItemTreeNode::addChildren ( const QList< ItemTreeNode * > &  list  )  [virtual, inherited]

Adds a list of children.

Definition at line 41 of file ItemTreeNode.cpp.

Referenced by BAstNode::mergeNamespaces().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ProjectNode::addFile ( const QString &  path  ) 

Adds a source or binary file to the project

Returns:
false if failure (file doesn't exist / unknown filetype)

Definition at line 258 of file Project.cpp.

Referenced by ProjectView::displayContextMenu(), and ProjectManager::loadProjectState().

Here is the call graph for this function:

Here is the caller graph for this function:

void ProjectNode::addToCommandLine ( const QString &  string  ) 

Definition at line 335 of file Project.cpp.

virtual ItemTreeNode* ItemTreeNode::child ( int  id  )  [inline, virtual, inherited]

Definition at line 34 of file ItemTreeNode.h.

Referenced by PropertyTreeModel::addEntryToSection(), getBinaryFile(), ItemTreeNode::getChildId(), ProjectManager::getMetricsConfig(), ProjectManager::getProject(), getSourceFile(), ItemTreeModel::index(), BAstNode::mergeNamespaces(), ItemTreeNode::setNotifyModel(), BAstNode::sortByType(), and ProjectManager::storeProjectState().

Here is the caller graph for this function:

virtual int ItemTreeNode::childrenCount (  )  const [inline, virtual, inherited]

Definition at line 39 of file ItemTreeNode.h.

Referenced by createBinFileHeaderNode(), getBinaryFileCount(), ProjectManager::getMetricsConfig(), ProjectManager::getProjectCount(), getSourceFileCount(), BAstNode::mergeNamespaces(), QtAstModel::rowCount(), ItemTreeModel::rowCount(), BAstNode::sortByType(), and ProjectManager::storeProjectState().

Here is the caller graph for this function:

void ProjectNode::createBinFileHeaderNode (  )  [inline, protected]

Definition at line 303 of file Project.cpp.

Referenced by addFile().

Here is the call graph for this function:

Here is the caller graph for this function:

void ProjectNode::createSrcFileHeaderNode (  )  [inline, protected]

The *fileHeaderNode are created when needed if you want to add something call these functions before they check if the node exists, if not create them

Definition at line 293 of file Project.cpp.

Referenced by addFile().

Here is the call graph for this function:

Here is the caller graph for this function:

QVariant ProjectNode::data ( int  role,
int  column = 0 
) const [virtual]

Returns the data of this node i.e. what is displayed, has to be reimplemented!

Parameters:
role a combination of enum Qt::ItemDataRole
column the column where this QVariant is displayed

Reimplemented from ItemTreeNode.

Definition at line 392 of file Project.cpp.

Qt::ItemFlags ItemTreeNode::flags ( int  column  )  const [virtual, inherited]

Definition at line 141 of file ItemTreeNode.cpp.

Referenced by ItemTreeModel::flags().

Here is the caller graph for this function:

BinaryFileNode * ProjectNode::getBinaryFile ( int  id  )  const

Definition at line 387 of file Project.cpp.

Here is the call graph for this function:

int ProjectNode::getBinaryFileCount (  )  const

Definition at line 379 of file Project.cpp.

Here is the call graph for this function:

SgIncidenceDirectedGraph * ProjectNode::getCallGraph (  ) 

TODO update graph when files are added.

returns the callgraph associated with this Project

Definition at line 405 of file Project.cpp.

Referenced by CallGraphWidget::updateGraph().

Here is the caller graph for this function:

int ItemTreeNode::getChildId ( ItemTreeNode child  )  [virtual, inherited]

Definition at line 130 of file ItemTreeNode.cpp.

Here is the call graph for this function:

QStringList ProjectNode::getCommandLine (  )  const

Expensive operation because conversion from std-container to QStringList, use getSgProject()->get_originalCommandLineArgumentList() if possible

Definition at line 320 of file Project.cpp.

Referenced by showCmdLineDialog().

Here is the caller graph for this function:

MetricsConfig* ProjectNode::getMetricsConfig (  )  [inline]

Definition at line 146 of file Project.h.

Referenced by ProjectManager::getMetricsConfig().

Here is the caller graph for this function:

const QString& ProjectNode::getName (  )  const [inline]

Definition at line 164 of file Project.h.

virtual ItemTreeNode* ItemTreeNode::getParent (  )  const [inline, virtual, inherited]

Definition at line 30 of file ItemTreeNode.h.

Referenced by AsmTreeInstructionNode::data(), AsmTreeFunctionNode::data(), QtAstModel::parent(), ItemTreeModel::parent(), BinaryFileNode::rebuild(), SourceFileNode::rebuild(), BinaryFileNode::submitFrontendTask(), BinaryFileNode::~BinaryFileNode(), and SourceFileNode::~SourceFileNode().

Here is the caller graph for this function:

int ItemTreeNode::getRow (  )  const [virtual, inherited]

Returns the row of this Node goes to the parent and returns the id it has in its children list

Definition at line 114 of file ItemTreeNode.cpp.

Referenced by ItemTreeModel::index(), and QtAstModel::parent().

Here is the caller graph for this function:

SgProject* ProjectNode::getSgProject (  )  [inline]

Definition at line 145 of file Project.h.

Referenced by ProjectManager::getSgProject(), BinaryFileNode::rebuild(), SourceFileNode::rebuild(), and BinaryFileNode::submitFrontendTask().

Here is the caller graph for this function:

SourceFileNode * ProjectNode::getSourceFile ( int  id  )  const

Definition at line 374 of file Project.cpp.

Here is the call graph for this function:

int ProjectNode::getSourceFileCount (  )  const

Definition at line 366 of file Project.cpp.

Here is the call graph for this function:

virtual bool ItemTreeNode::isFirstColumnSpanned (  )  const [inline, virtual, inherited]

If true the item spanns all columns in a row.

Reimplemented in AsmTreeFunctionNode, PropertyTreeModel::ItemTreeHeaderNode, and PropertyValueNode.

Definition at line 75 of file ItemTreeNode.h.

Referenced by ItemTreeModel::setupView().

Here is the caller graph for this function:

void ItemTreeNode::removeAllChildren (  )  [virtual, inherited]

Removes all children and deletes them.

Definition at line 76 of file ItemTreeNode.cpp.

void ItemTreeNode::removeChild ( int  id  )  [virtual, inherited]

Removes child, notifies model if setNotifiyModel was called.

Definition at line 62 of file ItemTreeNode.cpp.

Here is the call graph for this function:

QStringList ItemTreeNode::sectionHeader (  )  const [virtual, inherited]

List of Column-Header Captions.

Reimplemented in AsmTreeRootNode, BAstNode, ProjectManagerRootNode, PropertyTreeModel::ItemTreeHeaderNode, and PropertyValueNode.

Definition at line 136 of file ItemTreeNode.cpp.

Referenced by ItemTreeModel::setFixedRoot(), and ItemTreeModel::setRoot().

Here is the caller graph for this function:

void ProjectNode::setCommandLine ( const QStringList &  l  ) 

Definition at line 344 of file Project.cpp.

Referenced by ProjectManager::loadProjectState(), and showCmdLineDialog().

Here is the caller graph for this function:

void ItemTreeNode::setNotifyModel ( ItemTreeModel m  )  [virtual, inherited]

If you modify the ItemTree after using it in a model (via addChild) you have to call this function on the root node to set the model (such that model->beginInsertRows is called)

Definition at line 150 of file ItemTreeNode.cpp.

Referenced by ItemTreeNode::addChildAt(), ItemTreeModel::setFixedRoot(), ItemTreeNode::setNotifyModel(), and ItemTreeModel::setRoot().

Here is the call graph for this function:

Here is the caller graph for this function:

void ProjectNode::showCmdLineDialog (  ) 

Shows a dialog where the use can edit the rose frontend options.

Definition at line 355 of file Project.cpp.

Referenced by ProjectView::displayContextMenu().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename LessThan>
void ItemTreeNode::sortChildren ( LessThan  compareFunction  )  [inline, inherited]

Definition at line 84 of file ItemTreeNode.h.

Referenced by BAstNode::sortByType().

Here is the caller graph for this function:

template<typename LessThan>
void ItemTreeNode::sortChildrenStable ( LessThan  compareFunction  )  [inline, inherited]

Definition at line 89 of file ItemTreeNode.h.

Referenced by BAstNode::sortByType().

Here is the caller graph for this function:

void ItemTreeNode::takeAllChildren ( QList< ItemTreeNode * > &  output  )  [inherited]

Removes all children from the tree, but does not delete them the ownership is taken by the caller normally the taken children are added at another node

Definition at line 93 of file ItemTreeNode.cpp.

Referenced by BAstNode::mergeNamespaces().

Here is the caller graph for this function:


Member Data Documentation

BinaryFileHeaderNode* ProjectNode::binFileHeaderNode [protected]

Definition at line 182 of file Project.h.

Referenced by addFile(), createBinFileHeaderNode(), getBinaryFile(), and getBinaryFileCount().

SgIncidenceDirectedGraph* ProjectNode::callGraph [protected]

Definition at line 173 of file Project.h.

Referenced by getCallGraph().

QList<ItemTreeNode*> ItemTreeNode::children [protected, inherited]

Definition at line 95 of file ItemTreeNode.h.

Referenced by ItemTreeNode::addChild(), ItemTreeNode::addChildAt(), ItemTreeNode::addChildren(), ItemTreeNode::child(), ItemTreeNode::childrenCount(), QtAstModel::ModelNode::deleteChildren(), ItemTreeNode::getChildId(), ItemTreeNode::getRow(), ItemTreeNode::removeAllChildren(), ItemTreeNode::removeChild(), ItemTreeNode::setNotifyModel(), ItemTreeNode::sortChildren(), ItemTreeNode::sortChildrenStable(), ItemTreeNode::takeAllChildren(), and ItemTreeNode::~ItemTreeNode().

MetricsConfig* ProjectNode::metricsConfig [protected]

Definition at line 171 of file Project.h.

Referenced by addFile(), getMetricsConfig(), and ~ProjectNode().

QString ProjectNode::name [protected]

Definition at line 169 of file Project.h.

Referenced by data().

ItemTreeModel* ItemTreeNode::notifyModel [protected, inherited]

The model pointer is used to call beginInsertRows etc. if this mechanism is not used (tree not changed when shown) just leave at default NULL

Definition at line 100 of file ItemTreeNode.h.

Referenced by ItemTreeNode::addChildAt(), ItemTreeNode::addChildren(), ItemTreeNode::removeAllChildren(), ItemTreeNode::removeChild(), ItemTreeNode::setNotifyModel(), and ItemTreeNode::takeAllChildren().

ItemTreeNode* ItemTreeNode::parent [protected, inherited]

Definition at line 94 of file ItemTreeNode.h.

Referenced by ItemTreeNode::addChildAt(), ItemTreeNode::getParent(), ItemTreeNode::getRow(), and PropertyTreeModel::ItemTreePropValueNode::getSectionId().

SgProject* ProjectNode::sgProject [protected]

Definition at line 170 of file Project.h.

Referenced by addFile(), addToCommandLine(), data(), getCallGraph(), getCommandLine(), getSgProject(), ProjectNode(), setCommandLine(), and ~ProjectNode().

SourceFileHeaderNode* ProjectNode::srcFileHeaderNode [protected]

Definition at line 181 of file Project.h.

Referenced by addFile(), createSrcFileHeaderNode(), getSourceFile(), and getSourceFileCount().


The documentation for this class was generated from the following files:
Generated on Tue Sep 15 14:48:49 2009 for RoseQtWidgets by  doxygen 1.4.7