InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ChangeTree< ItemType > Class Template Reference

#include <ChangeTree.h>

Public Types

typedef TreeNode< ItemType > Node
 

Public Member Functions

 ChangeTree ()
 
 ChangeTree (const ChangeTree &o)
 
 ~ChangeTree ()
 
ChangeTreeoperator= (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)
 
Nodefind (ItemType item)
 
NodeGetRoot ()
 

Detailed Description

template<class ItemType>
class ChangeTree< ItemType >

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.

Member Typedef Documentation

template<class ItemType>
typedef TreeNode<ItemType> ChangeTree< ItemType >::Node

Just a simpler thing to type for clients

Constructor & Destructor Documentation

template<class ItemType>
ChangeTree< ItemType >::ChangeTree()
inline

Default constructor

template<class ItemType>
ChangeTree< ItemType >::ChangeTree(const ChangeTree< ItemType > & o)

Copy constructor

Parameters
o- The object to copy
template<class ItemType>
ChangeTree< ItemType >::~ChangeTree()
inline

Destructor

Member Function Documentation

template<class ItemType>
void ChangeTree< ItemType >::CloneBranch (NodemyStart,
const NodeotherStart 
)

Use this to clone a branch of the tree. New nodes will be created that match the nodes in the other branch.

Parameters
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
template<class ItemType>
Node* ChangeTree< ItemType >::find (ItemType item)

This method will look up a node given a unique identifier.

Parameters
item- the item you are looking up
Returns
Node - The node that corresponds to the item
template<class ItemType>
Node* ChangeTree< ItemType >::GetRoot ()

Get the root node of the tree

Returns
Node - the node at the root of the tree
template<class ItemType>
void ChangeTree< ItemType >::Insert (Nodenode,
Nodeparent 
)

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

Parameters
node- the new node to be inserted
parent- the parent of this node
template<class ItemType>
ChangeTree& ChangeTree< ItemType >::operator= (const ChangeTree< ItemType > & o)

Assignment Operator

Parameters
o- The object to copy
Returns
- A pointer to this object
template<class ItemType>
void ChangeTree< ItemType >::Remove (Nodenode)

Remove a node and its children from this tree.

Parameters
node- the node to be removed
template<class ItemType>
int ChangeTree< ItemType >::size () const

Use this to get the size of the tree

template<class ItemType>
void ChangeTree< ItemType >::swap (ChangeTree< ItemType > & o)

Use this to swap the contents of this object with the contents of another object.

Parameters
ChangeTree- The object with which you want to swap data