ALBA
|
#include <albaVMEIterator.h>
Public Types | |
enum | traversalMode { PreOrder =0 , PostOrder } |
Public Member Functions | |
albaTypeMacro (albaVMEIterator, albaObject) | |
albaVME * | GetCurrentNode () |
albaVME * | GetFirstNode () |
albaVME * | GetLastNode () |
albaVME * | GetNextNode () |
albaVME * | GetPreviousNode () |
virtual bool | IsVisible (albaVME *node) |
virtual void | IgnoreVisibleToTraverse (bool ignore) |
void | SetRootNode (albaVME *root) |
void | InitTraversal () |
int | IsDoneWithTraversal () |
virtual int | GoToNextNode () |
virtual int | GoToPreviousNode () |
virtual int | GoToFirstNode () |
virtual int | GoToLastNode () |
void | SetTraversalMode (int mode) |
int | GetTraversalMode () |
void | SetTraversalModeToPreOrder () |
void | SetTraversalModeToPostOrder () |
Public Member Functions inherited from albaObject | |
albaObject () | |
virtual | ~albaObject () |
virtual void | Delete () |
virtual const char * | GetTypeName () const |
virtual bool | IsA (const char *type_name) const |
virtual bool | IsA (const albaTypeID &type_id) const |
virtual albaObject * | NewObjectInstance () const =0 |
virtual const albaTypeID & | GetTypeId () const |
virtual void | Print (std::ostream &os, const int indent=0) const |
albaObject (const albaObject &c) | |
Protected Member Functions | |
albaVME * | FindLeftMostLeaf (albaVME *node) |
albaVME * | FindRightMostLeaf (albaVME *node) |
albaVMEIterator (albaVME *root=NULL) | |
virtual | ~albaVMEIterator () |
Protected Attributes | |
albaVME * | m_RootNode |
albaVME * | m_CurrentNode |
int | m_TraversalMode |
int | m_TraversalDone |
bool | m_IgnoreVisibleToTraverse |
albaVector< albaID > | m_CurrentIdx |
Protected Attributes inherited from albaObject | |
bool | m_HeapFlag |
Additional Inherited Members | |
Static Public Member Functions inherited from albaObject | |
static const char * | GetStaticTypeName () |
static bool | IsStaticType (const char *type_name) |
static bool | IsStaticType (const albaTypeID &type_id) |
static const albaTypeID & | GetStaticTypeId () |
static albaObject * | SafeDownCast (albaObject *o) |
albaVMEIterator - an m-way tree data structure iterator albaVMEIterator is a class to traverse a tree data structure.
It allows to set the traverse modality. The iterator allows to set some callback to the traverse by means of the ALBA Subject/Observer mechanism. Issued events are: "PreTraversal","PostTraversal","Deeper","Upper","FirstNode", "LastNode", "Done". These can be overidden by adding an observer
Definition at line 39 of file albaVMEIterator.h.
Set the traverse modality to InOrder: first the the left subtrees (left to right), then right subtrees (left to right), and finally the root.
The partioning of the sub-trees is dicotomic. This mode is useful for B-Tree's traversing
Enumerator | |
---|---|
PreOrder | |
PostOrder |
Definition at line 114 of file albaVMEIterator.h.
|
protected |
|
protectedvirtual |
albaVMEIterator::albaTypeMacro | ( | albaVMEIterator | , |
albaObject | |||
) |
|
inline |
Retrieve the current node pointer data from the iterator.
Definition at line 45 of file albaVMEIterator.h.
|
inline |
Shortcut to traverse the tree.
Definition at line 48 of file albaVMEIterator.h.
|
inline |
Shortcut to traverse the tree.
Definition at line 50 of file albaVMEIterator.h.
|
inline |
Shortcut to traverse the tree.
Definition at line 52 of file albaVMEIterator.h.
|
inline |
Shortcut to traverse the tree.
Definition at line 54 of file albaVMEIterator.h.
|
inlinevirtual |
Return true if the VME is visible.
This function can be overridden to implement different visibility rules.
Definition at line 59 of file albaVMEIterator.h.
References albaVME::IsVisible().
|
inlinevirtual |
Allow to ignore m_VisibleToTraverse flag for the iterator.
Definition at line 62 of file albaVMEIterator.h.
void albaVMEIterator::SetRootNode | ( | albaVME * | root | ) |
Set the root node of the (sub)tree to be traversed.
Used to set the start point.
void albaVMEIterator::InitTraversal | ( | ) |
Initialize the traversal of the container.
Set the iterator to the "beginning" of the container.
|
inline |
Check if the iterator is at the end of the container.
Returns 1 for yes and 0 for no.
Definition at line 77 of file albaVMEIterator.h.
|
virtual |
Increment the iterator to the next location.
|
virtual |
Decrement the iterator to the next location.
|
virtual |
Go to the first item of the list.
|
virtual |
Go to the last item of the list.
void albaVMEIterator::SetTraversalMode | ( | int | mode | ) |
Set/Get the traverse modality.
Default to PreOrder, i.e. process first the root an then the sub trees (left to right). Change the traverse mode restart the traversing!
|
inline |
Definition at line 96 of file albaVMEIterator.h.
|
inline |
Set the traverse modality to PreOrder: first the root then the subtrees left to right.
Definition at line 101 of file albaVMEIterator.h.
|
inline |
Set the traverse modality to PostOrder: first the the subtrees left to right, then the root.
Definition at line 105 of file albaVMEIterator.h.
Find the left most leaf of the tree.
Find the right most leaf of the tree.
|
protected |
Definition at line 127 of file albaVMEIterator.h.
|
protected |
Definition at line 128 of file albaVMEIterator.h.
|
protected |
Definition at line 129 of file albaVMEIterator.h.
|
protected |
Definition at line 130 of file albaVMEIterator.h.
|
protected |
Definition at line 131 of file albaVMEIterator.h.
|
protected |
Definition at line 133 of file albaVMEIterator.h.