ProjectManager Class Reference

Central (singleton) class for managing SgProjects. More...

#include <Project.h>

Inheritance diagram for ProjectManager:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~ProjectManager ()
int addProject (const QString &projectName)
ProjectNodegetProject (int id)
 Access function for getting information.
int getProjectCount () const
SgProject * getSgProject (int id)
MetricsConfiggetMetricsConfig (int id)
MetricsConfiggetMetricsConfig (SgNode *node)
void setTaskListWidget (TaskList *l)
 Each.
void setTaskMsgOutputWidget (QWidget *wdg)
TaskListtaskListWidget ()
QWidget * taskOutputWidget ()
ProjectManagerRootNodegetModelRootNode ()
int getIdFromSgProject (SgProject *proj)
void storeProjectState ()
void loadProjectState (int argc, char **argv)
virtual QVariant data (int role, int column=0) 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)

Static Public Member Functions

static ProjectManagerinstance ()

Protected Attributes

ItemTreeNodeparent
QList< ItemTreeNode * > children
ItemTreeModelnotifyModel

Private Member Functions

 ProjectManager ()

Private Attributes

ProjectManagerRootNoderootNode
TaskListtaskListWdg
QWidget * taskOutputWdg

Static Private Attributes

static ProjectManagersingle = NULL

Detailed Description

Central (singleton) class for managing SgProjects.

Singleton class for management of SgProject's is derived from ItemTreeNode because it's also used for displaying a project-tree in ProjectView

Usage:

See also:
ProjectNode

Definition at line 36 of file Project.h.


Constructor & Destructor Documentation

ProjectManager::~ProjectManager (  )  [virtual]

Definition at line 50 of file Project.cpp.

Here is the call graph for this function:

ProjectManager::ProjectManager (  )  [private]

Definition at line 43 of file Project.cpp.

Referenced by instance().

Here is the caller graph for this function:


Member Function Documentation

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(), ProjectNode::addFile(), addProject(), PropertyTreeModel::addSection(), buildAsmTreeDiff(), buildAsmTreeVisit(), BAstNode::generate(), BAstNode::generationVisit(), and 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(), ProjectNode::createBinFileHeaderNode(), and ProjectNode::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:

int ProjectManager::addProject ( const QString &  projectName  ) 

Creates an empty project with given name

Returns:
a project id, can be used to get projectNode: getProject()

Definition at line 61 of file Project.cpp.

Here is the call graph for this function:

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

Definition at line 34 of file ItemTreeNode.h.

Referenced by PropertyTreeModel::addEntryToSection(), ProjectNode::getBinaryFile(), ItemTreeNode::getChildId(), getMetricsConfig(), getProject(), ProjectNode::getSourceFile(), ItemTreeModel::index(), BAstNode::mergeNamespaces(), ItemTreeNode::setNotifyModel(), BAstNode::sortByType(), and 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 ProjectNode::createBinFileHeaderNode(), ProjectNode::getBinaryFileCount(), getMetricsConfig(), getProjectCount(), ProjectNode::getSourceFileCount(), BAstNode::mergeNamespaces(), QtAstModel::rowCount(), ItemTreeModel::rowCount(), BAstNode::sortByType(), and storeProjectState().

Here is the caller graph for this function:

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

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 in AsmTreeFunctionNode, AsmTreeInstructionNode, QtAstModel::ModelNode, BAstNode, ProjectNode, SourceFileHeaderNode, SourceFileNode, BinaryFileHeaderNode, BinaryFileNode, PropertyTreeModel::ItemTreeHeaderNode, PropertyTreeModel::ItemTreePropValueNode, and PropertyValueNode.

Definition at line 125 of file ItemTreeNode.cpp.

Referenced by ItemTreeModel::data().

Here is the caller graph for this function:

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:

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

Definition at line 130 of file ItemTreeNode.cpp.

Here is the call graph for this function:

int ProjectManager::getIdFromSgProject ( SgProject *  proj  ) 

Definition at line 197 of file Project.cpp.

Referenced by CallGraphWidget::updateGraph().

Here is the call graph for this function:

Here is the caller graph for this function:

MetricsConfig * ProjectManager::getMetricsConfig ( SgNode *  node  ) 

Definition at line 88 of file Project.cpp.

Here is the call graph for this function:

MetricsConfig * ProjectManager::getMetricsConfig ( int  id  ) 

Returns the MetricsConfig object for a project this object holds information about normalization of all MetricsAttributes in the project

Definition at line 74 of file Project.cpp.

Referenced by AsmView::updateModel().

Here is the call graph for this function:

Here is the caller graph for this function:

ProjectManagerRootNode * ProjectManager::getModelRootNode (  ) 

Definition at line 56 of file Project.cpp.

Referenced by ProjectView::ProjectView().

Here is the caller graph for this function:

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:

ProjectNode * ProjectManager::getProject ( int  id  ) 

Access function for getting information.

Definition at line 67 of file Project.cpp.

Referenced by getIdFromSgProject(), getMetricsConfig(), getSgProject(), and CallGraphWidget::updateGraph().

Here is the call graph for this function:

Here is the caller graph for this function:

int ProjectManager::getProjectCount (  )  const

Definition at line 190 of file Project.cpp.

Referenced by getIdFromSgProject(), and getMetricsConfig().

Here is the call graph for this function:

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 * ProjectManager::getSgProject ( int  id  ) 

Definition at line 185 of file Project.cpp.

Referenced by getIdFromSgProject(), and getMetricsConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

ProjectManager * ProjectManager::instance (  )  [static]

Definition at line 35 of file Project.cpp.

Referenced by TaskList::on_itemClicked(), ProjectView::ProjectView(), SourceFileNode::rebuild(), BinaryFileNode::submitCompileTask(), BinaryFileNode::submitFrontendTask(), CallGraphWidget::updateGraph(), and AsmView::updateModel().

Here is the call graph for this function:

Here is the caller 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 ProjectManager::loadProjectState ( int  argc,
char **  argv 
)

Definition at line 149 of file Project.cpp.

Here is the call 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 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 ProjectManager::setTaskListWidget ( TaskList l  )  [inline]

Each.

Definition at line 60 of file Project.h.

void ProjectManager::setTaskMsgOutputWidget ( QWidget *  wdg  )  [inline]

Definition at line 61 of file Project.h.

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 ProjectManager::storeProjectState (  ) 

Definition at line 113 of file Project.cpp.

Referenced by ~ProjectManager().

Here is the call graph for this function:

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:

TaskList* ProjectManager::taskListWidget (  )  [inline]

Definition at line 63 of file Project.h.

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

Here is the caller graph for this function:

QWidget* ProjectManager::taskOutputWidget (  )  [inline]

Definition at line 64 of file Project.h.

Referenced by TaskList::on_itemClicked().


Member Data Documentation

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().

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().

ProjectManagerRootNode* ProjectManager::rootNode [private]

Definition at line 78 of file Project.h.

Referenced by addProject(), getMetricsConfig(), getModelRootNode(), getProject(), getProjectCount(), loadProjectState(), storeProjectState(), and ~ProjectManager().

ProjectManager * ProjectManager::single = NULL [static, private]

Definition at line 75 of file Project.h.

Referenced by instance().

TaskList* ProjectManager::taskListWdg [private]

Definition at line 80 of file Project.h.

Referenced by setTaskListWidget(), and taskListWidget().

QWidget* ProjectManager::taskOutputWdg [private]

Definition at line 81 of file Project.h.

Referenced by setTaskMsgOutputWidget(), and taskOutputWidget().


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