![]() | InDesign SDK 20.5 |
#include <ChangeTree.h>
Public Types | |
| typedef TreeNode< ItemType > | Node |
Public Member Functions | |
| ChangeTree () | |
| ChangeTree (const ChangeTree &o) | |
| ~ChangeTree () | |
| ChangeTree & | operator= (const ChangeTree &o) |
| void | swap (ChangeTree &o) |
| int | size () const |
| void | CloneBranch (Node *myStart, const Node *otherStart) |
| void | Insert (Node *node, Node *parent) |
| void | Remove (Node *node) |
| Node * | find (ItemType item) |
| Node * | GetRoot () |
Used to hold information about changes nodes in a tree. NOTE: This tree does NOT sort the child nodes in any order. They are simply inserted into the tree in the location that we decide. Because of this you cannot expect to walk the children looking for more meaning- ful information than just the parent-child relation- ships.
| typedef TreeNode<ItemType> ChangeTree< ItemType >::Node |
Just a simpler thing to type for clients
| inline |
Default constructor
| ChangeTree< ItemType >::ChangeTree | ( | const ChangeTree< ItemType > & | o | ) |
Copy constructor
| o | - The object to copy |
| inline |
Destructor
| void ChangeTree< ItemType >::CloneBranch | ( | Node * | myStart, |
| const Node * | otherStart | ||
| ) |
Use this to clone a branch of the tree. New nodes will be created that match the nodes in the other branch.
| myStart | - The node under which to add the new branch. If this is a nil pointer the branch will be added as root |
| otherStart | - The beginning of the other branch |
| Node* ChangeTree< ItemType >::find | ( | ItemType | item | ) |
This method will look up a node given a unique identifier.
| item | - the item you are looking up |
| Node* ChangeTree< ItemType >::GetRoot | ( | ) |
Get the root node of the tree
| void ChangeTree< ItemType >::Insert | ( | Node * | node, |
| Node * | parent | ||
| ) |
Insert a new node into the tree. NOTE: Once you insert a node into this tree the tree owns it. You can ask for a node to get information but the tree will handle deletion of the node
| node | - the new node to be inserted |
| parent | - the parent of this node |
| ChangeTree& ChangeTree< ItemType >::operator= | ( | const ChangeTree< ItemType > & | o | ) |
Assignment Operator
| o | - The object to copy |
| void ChangeTree< ItemType >::Remove | ( | Node * | node | ) |
Remove a node and its children from this tree.
| node | - the node to be removed |
| int ChangeTree< ItemType >::size | ( | ) | const |
Use this to get the size of the tree
| void ChangeTree< ItemType >::swap | ( | ChangeTree< ItemType > & | o | ) |
Use this to swap the contents of this object with the contents of another object.
| ChangeTree | - The object with which you want to swap data |