AETreeWalker Class Reference

This class walks through an AE tree in a pre-order traversal fashion. More...

List of all members.

Public Member Functions

 AETreeWalker (AENode *in_root)
 Constructor.
AENodeGetNext ()
 Return the next node in a pre-order traversal fashion.
simba_size_t GetNextLevel () const
 Return the level of the next node in the tree.
bool HasMore () const
 Indicates whether there are more nodes.
AENodePeekNext ()
 Peek at the next node in a pre-order traversal fashion.
void SkipCurSubTree ()
 Skip the current sub tree.
 ~AETreeWalker ()
 Destructor.

Detailed Description

This class walks through an AE tree in a pre-order traversal fashion.

That is, the first node that it returns is the root node. The second node it returns is the first child of the root node.

The class has been designed so that it only traverses the sub tree that has in_root as the root node. It will never traverse the parent nodes of in_root if it has a parent node.


Constructor & Destructor Documentation

AETreeWalker ( AENode in_root  )  [explicit]

Constructor.

Parameters:
in_root The root node of an AE tree. (NOT OWN)
Exceptions:
SEInvalidArgumentException when in_root is NULL
~AETreeWalker (  ) 

Destructor.


Member Function Documentation

AENode* GetNext (  ) 

Return the next node in a pre-order traversal fashion.

Make sure there are more nodes to walk through.

Exceptions:
SEInvalidOpertionException when HasMore() returns false.
Returns:
The next node in a pre-order traversal fashion. (NOT OWN)
simba_size_t GetNextLevel (  )  const

Return the level of the next node in the tree.

The root of the tree is level 0. The child nodes of the root are all level 1. The child nodes of the child nodes of the root are all level 2, etc.

If one wants to get the tree level for the next node, one MUST call this method before calling GetNext(). The reason is that after calling GetNext(), the tree level returned from this method is for the next node.

Exceptions:
SEInvalidOperationException when HasMore() returns false.
Returns:
The level of the next node.
bool HasMore (  )  const

Indicates whether there are more nodes.

Returns:
true if there are more nodes, false otherwise.
AENode* PeekNext (  ) 

Peek at the next node in a pre-order traversal fashion.

Returns:
The next node in a pre-order traversal fashion. (NOT OWN)
void SkipCurSubTree (  ) 

Skip the current sub tree.

The general usage is that after calling GetNext() and finding out the current node, the user can choose to skip certain nodes and their child nodes.

Exceptions:
SEInvalidOperationException when GetNext() has not been called.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:17 2017 for SimbaEngine 10.1.3.1011 by simba