#include <CTree.h>
Inheritance diagram for CTreeNode:
Public Types | |
Front | |
End | |
enum | Where { Front, End } |
Public Member Functions | |
CTreeNode () | |
CTreeNode (const CTreeNode &cSource) | |
virtual | ~CTreeNode () |
virtual CTreeNode * | append (CTreeNode *pcNode, Where w=End) |
virtual CTreeNode * | append (CTreeNode *pcWhere, CTreeNode *pcAppend, Where w=End) |
virtual CTreeNode * | insert (CTreeNode *pcWhere, CTreeNode *pcInsert) |
virtual void | remove (CTreeNode *pcRemove) |
virtual void | remove (CTreeTraverserBase *pcTraverser) |
virtual void | replace (CTreeNode *pcReplace, CTreeNode *pcWith) |
virtual CTreeNode * | getParent () const |
virtual int | numChildren () const |
virtual const CList< CTreeNode > & | getChildrenList () const |
virtual CTreeNode & | operator= (const CTreeNode &cSource) |
virtual CTreeNode & | operator[] (int i) const |
virtual bool | isEqual (const CTreeNode *pcNode) const |
virtual void | printTree (ostream &out=cout) const |
Protected Member Functions | |
virtual void | print (ostream &out) const |
Protected Attributes | |
CTreeNode * | m_pcParent |
CList< CTreeNode > | m_cChildrenList |
Friends | |
ostream & | operator<< (ostream &out, CTreeNode *pcTreeNode) |
enum CTreeNode::Where |
CTreeNode::CTreeNode | ( | ) | [inline] |
Default constructor.
CTreeNode::CTreeNode | ( | const CTreeNode & | cSource | ) |
Copy constructor.
CTreeNode::~CTreeNode | ( | ) | [virtual] |
Destructor.
virtual CTreeNode* CTreeNode::append | ( | CTreeNode * | pcWhere, | |
CTreeNode * | pcAppend, | |||
Where | w = End | |||
) | [inline, virtual] |
Appends the node 'pcAppend' to the children list of node 'pcWhere'. The tree makes a copy of the node, so you can delete the source after appending.
Appends the node 'cNode' to the children list of this node.
Returns the list of children nodes of this node.
virtual CTreeNode* CTreeNode::getParent | ( | ) | const [inline, virtual] |
Returns the parent node.
Exchanges the node 'pcWhere' against 'pcInsert'. The node 'pcWhere' will be appended to the children list of 'pcInsert'. The parent node of the inserted one is returned.
bool CTreeNode::isEqual | ( | const CTreeNode * | pcNode | ) | const [virtual] |
Compares two node.
virtual int CTreeNode::numChildren | ( | ) | const [inline, virtual] |
Returns the number of children of this node.
Assigns one node to another.
CTreeNode & CTreeNode::operator[] | ( | int | i | ) | const [virtual] |
Returns the i-th child of this node.
void CTreeNode::print | ( | ostream & | out | ) | const [protected, virtual] |
void CTreeNode::printTree | ( | ostream & | out = cout |
) | const [virtual] |
Prints the tree that starts at this node in breath-first-order.
void CTreeNode::remove | ( | CTreeTraverserBase * | pcTraverser | ) | [virtual] |
Remove the node which the iterater points to from the tree.
void CTreeNode::remove | ( | CTreeNode * | pcRemove | ) | [virtual] |
Remove the specified node from the tree.
Replaces the node given by 'pcReplace' with another given by 'pcWith'.
ostream& operator<< | ( | ostream & | out, | |
CTreeNode * | pcTreeNode | |||
) | [friend] |
CList<CTreeNode> CTreeNode::m_cChildrenList [protected] |
CTreeNode* CTreeNode::m_pcParent [protected] |