BAstNode Class Reference

A treenode of a Beautified AST. More...

#include <BAstNode.h>

Inheritance diagram for BAstNode:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BAstNode (AstDisplayInfo::NodeType type, const QString &caption, const QString &tooltip, const QIcon &icon, SgNode *sg)
 BAstNode (AstDisplayInfo::NodeType type, const QString &caption, SgNode *sg)
 BAstNode (SgNode *node)
virtual ~BAstNode ()
void setCaption (const QString &cap)
AstDisplayInfo::NodeType getType () const
SgNode * sgNode () const
virtual QVariant data (int role, int column) const
 Overwritten Data for returning Item-Data.
virtual QStringList sectionHeader () const
 List of Column-Header Captions.
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 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 ItemTreeNodegenerate (SgNode *sgRoot, AstFilterInterface *filter, ItemTreeNode *root=NULL)
 Generates a new tree.

Static Protected Member Functions

static void generationVisit (SgNode *node, ItemTreeNode *bAstNode, int fileId, AstFilterInterface *filter)
static void sortByType (ItemTreeNode *node)
static void mergeNamespaces (ItemTreeNode *root)
static bool lessThanByType (ItemTreeNode *n1, ItemTreeNode *n2)
static bool lessThanByCaption (ItemTreeNode *n1, ItemTreeNode *n2)

Protected Attributes

AstDisplayInfo::NodeType type
QString caption
QString tooltip
SgNode * sg
QIcon icon
ItemTreeNodeparent
QList< ItemTreeNode * > children
ItemTreeModelnotifyModel

Private Member Functions

SgNode * getFunctionDeclaration (SgNode *sgNode)

Detailed Description

A treenode of a Beautified AST.

This class represents the display information of a tree node in a Beautified AST A beautified AST shows only function, classes, namespace etc. the "beautified" ast's are ment to shown to a user which is not familiar with ROSE datastructures

Definition at line 19 of file BAstNode.h.


Constructor & Destructor Documentation

BAstNode::BAstNode ( AstDisplayInfo::NodeType  type,
const QString &  caption,
const QString &  tooltip,
const QIcon &  icon,
SgNode *  sg 
)

Definition at line 14 of file BAstNode.cpp.

Referenced by generate(), and generationVisit().

Here is the call graph for this function:

Here is the caller graph for this function:

BAstNode::BAstNode ( AstDisplayInfo::NodeType  type,
const QString &  caption,
SgNode *  sg 
)

Definition at line 30 of file BAstNode.cpp.

Here is the call graph for this function:

BAstNode::BAstNode ( SgNode *  node  ) 

Definition at line 43 of file BAstNode.cpp.

Here is the call graph for this function:

BAstNode::~BAstNode (  )  [virtual]

Definition at line 54 of file BAstNode.cpp.


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(), ProjectManager::addProject(), PropertyTreeModel::addSection(), buildAsmTreeDiff(), buildAsmTreeVisit(), generate(), 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(), 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 mergeNamespaces().

Here is the call graph for this function:

Here is the caller 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(), ProjectManager::getMetricsConfig(), ProjectManager::getProject(), ProjectNode::getSourceFile(), ItemTreeModel::index(), mergeNamespaces(), ItemTreeNode::setNotifyModel(), 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 ProjectNode::createBinFileHeaderNode(), ProjectNode::getBinaryFileCount(), ProjectManager::getMetricsConfig(), ProjectManager::getProjectCount(), ProjectNode::getSourceFileCount(), mergeNamespaces(), QtAstModel::rowCount(), ItemTreeModel::rowCount(), sortByType(), and ProjectManager::storeProjectState().

Here is the caller graph for this function:

QVariant BAstNode::data ( int  role,
int  column 
) const [virtual]

Overwritten Data for returning Item-Data.

Reimplemented from ItemTreeNode.

Definition at line 64 of file BAstNode.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:

ItemTreeNode * BAstNode::generate ( SgNode *  sgRoot,
AstFilterInterface filter,
ItemTreeNode root = NULL 
) [static]

Generates a new tree.

Definition at line 79 of file BAstNode.cpp.

Referenced by SourceFileNode::buildTaskFinished(), BinaryFileNode::frontendTaskFinished(), BAstView::updateModel(), and BAstModel::updateModel().

Here is the call graph for this function:

Here is the caller graph for this function:

void BAstNode::generationVisit ( SgNode *  node,
ItemTreeNode bAstNode,
int  fileId,
AstFilterInterface filter 
) [static, protected]

Definition at line 168 of file BAstNode.cpp.

Referenced by generate().

Here is the call graph for this function:

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:

SgNode * BAstNode::getFunctionDeclaration ( SgNode *  sgNode  )  [private]

Definition at line 276 of file BAstNode.cpp.

Referenced by BAstNode().

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:

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:

AstDisplayInfo::NodeType BAstNode::getType (  )  const [inline]

Definition at line 44 of file BAstNode.h.

Referenced by lessThanByType(), and mergeNamespaces().

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:

bool BAstNode::lessThanByCaption ( ItemTreeNode n1,
ItemTreeNode n2 
) [static, protected]

Definition at line 207 of file BAstNode.cpp.

Referenced by sortByType().

Here is the caller graph for this function:

bool BAstNode::lessThanByType ( ItemTreeNode n1,
ItemTreeNode n2 
) [static, protected]

Definition at line 199 of file BAstNode.cpp.

Referenced by sortByType().

Here is the call graph for this function:

Here is the caller graph for this function:

void BAstNode::mergeNamespaces ( ItemTreeNode root  )  [static, protected]

removes double namespace entries if two adjacent children are namespaces and have same name delete the second (call sortByType first!)

Definition at line 226 of file BAstNode.cpp.

Referenced by generate().

Here is the call graph for this function:

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 BAstNode::sectionHeader (  )  const [virtual]

List of Column-Header Captions.

Reimplemented from ItemTreeNode.

Definition at line 59 of file BAstNode.cpp.

void BAstNode::setCaption ( const QString &  cap  )  [inline]

Definition at line 42 of file BAstNode.h.

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:

SgNode* BAstNode::sgNode (  )  const [inline]

Definition at line 47 of file BAstNode.h.

Referenced by BAstModel::getNodeFromIndex().

Here is the caller graph for this function:

void BAstNode::sortByType ( ItemTreeNode node  )  [static, protected]

Sorts the children of a node by type first files, than namespaces ...

Definition at line 217 of file BAstNode.cpp.

Referenced by generate().

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

Here is the caller graph for this function:


Member Data Documentation

QString BAstNode::caption [protected]

Definition at line 75 of file BAstNode.h.

Referenced by data(), lessThanByCaption(), and mergeNamespaces().

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

QIcon BAstNode::icon [protected]

Definition at line 78 of file BAstNode.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().

SgNode* BAstNode::sg [protected]

Definition at line 77 of file BAstNode.h.

Referenced by BAstNode(), and data().

QString BAstNode::tooltip [protected]

Definition at line 76 of file BAstNode.h.

Referenced by data().

AstDisplayInfo::NodeType BAstNode::type [protected]

Definition at line 74 of file BAstNode.h.


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