ALBA
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
albaVMEIterator Class Reference

#include <albaVMEIterator.h>

Inheritance diagram for albaVMEIterator:
Inheritance graph
[legend]
Collaboration diagram for albaVMEIterator:
Collaboration graph
[legend]

Public Types

enum  traversalMode { PreOrder =0 , PostOrder }
 

Public Member Functions

 albaTypeMacro (albaVMEIterator, albaObject)
 
albaVMEGetCurrentNode ()
 
albaVMEGetFirstNode ()
 
albaVMEGetLastNode ()
 
albaVMEGetNextNode ()
 
albaVMEGetPreviousNode ()
 
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 albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 

Protected Member Functions

albaVMEFindLeftMostLeaf (albaVME *node)
 
albaVMEFindRightMostLeaf (albaVME *node)
 
 albaVMEIterator (albaVME *root=NULL)
 
virtual ~albaVMEIterator ()
 

Protected Attributes

albaVMEm_RootNode
 
albaVMEm_CurrentNode
 
int m_TraversalMode
 
int m_TraversalDone
 
bool m_IgnoreVisibleToTraverse
 
albaVector< albaIDm_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 albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 

Detailed Description

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

See also
albaVME

Definition at line 39 of file albaVMEIterator.h.

Member Enumeration Documentation

◆ traversalMode

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.

Constructor & Destructor Documentation

◆ albaVMEIterator()

albaVMEIterator::albaVMEIterator ( albaVME root = NULL)
protected

◆ ~albaVMEIterator()

virtual albaVMEIterator::~albaVMEIterator ( )
protectedvirtual

Member Function Documentation

◆ albaTypeMacro()

albaVMEIterator::albaTypeMacro ( albaVMEIterator  ,
albaObject   
)

◆ GetCurrentNode()

albaVME * albaVMEIterator::GetCurrentNode ( )
inline

Retrieve the current node pointer data from the iterator.

Definition at line 45 of file albaVMEIterator.h.

◆ GetFirstNode()

albaVME * albaVMEIterator::GetFirstNode ( )
inline

Shortcut to traverse the tree.

Definition at line 48 of file albaVMEIterator.h.

◆ GetLastNode()

albaVME * albaVMEIterator::GetLastNode ( )
inline

Shortcut to traverse the tree.

Definition at line 50 of file albaVMEIterator.h.

◆ GetNextNode()

albaVME * albaVMEIterator::GetNextNode ( )
inline

Shortcut to traverse the tree.

Definition at line 52 of file albaVMEIterator.h.

◆ GetPreviousNode()

albaVME * albaVMEIterator::GetPreviousNode ( )
inline

Shortcut to traverse the tree.

Definition at line 54 of file albaVMEIterator.h.

◆ IsVisible()

virtual bool albaVMEIterator::IsVisible ( albaVME node)
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().

Here is the call graph for this function:

◆ IgnoreVisibleToTraverse()

virtual void albaVMEIterator::IgnoreVisibleToTraverse ( bool  ignore)
inlinevirtual

Allow to ignore m_VisibleToTraverse flag for the iterator.

Definition at line 62 of file albaVMEIterator.h.

◆ SetRootNode()

void albaVMEIterator::SetRootNode ( albaVME root)

Set the root node of the (sub)tree to be traversed.

Used to set the start point.

◆ InitTraversal()

void albaVMEIterator::InitTraversal ( )

Initialize the traversal of the container.

Set the iterator to the "beginning" of the container.

◆ IsDoneWithTraversal()

int albaVMEIterator::IsDoneWithTraversal ( )
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.

◆ GoToNextNode()

virtual int albaVMEIterator::GoToNextNode ( )
virtual

Increment the iterator to the next location.

◆ GoToPreviousNode()

virtual int albaVMEIterator::GoToPreviousNode ( )
virtual

Decrement the iterator to the next location.

◆ GoToFirstNode()

virtual int albaVMEIterator::GoToFirstNode ( )
virtual

Go to the first item of the list.

◆ GoToLastNode()

virtual int albaVMEIterator::GoToLastNode ( )
virtual

Go to the last item of the list.

◆ SetTraversalMode()

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!

◆ GetTraversalMode()

int albaVMEIterator::GetTraversalMode ( )
inline

Definition at line 96 of file albaVMEIterator.h.

◆ SetTraversalModeToPreOrder()

void albaVMEIterator::SetTraversalModeToPreOrder ( )
inline

Set the traverse modality to PreOrder: first the root then the subtrees left to right.

Definition at line 101 of file albaVMEIterator.h.

◆ SetTraversalModeToPostOrder()

void albaVMEIterator::SetTraversalModeToPostOrder ( )
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.

◆ FindLeftMostLeaf()

albaVME * albaVMEIterator::FindLeftMostLeaf ( albaVME node)
protected

Find the left most leaf of the tree.

◆ FindRightMostLeaf()

albaVME * albaVMEIterator::FindRightMostLeaf ( albaVME node)
protected

Find the right most leaf of the tree.

Member Data Documentation

◆ m_RootNode

albaVME* albaVMEIterator::m_RootNode
protected

Definition at line 127 of file albaVMEIterator.h.

◆ m_CurrentNode

albaVME* albaVMEIterator::m_CurrentNode
protected

Definition at line 128 of file albaVMEIterator.h.

◆ m_TraversalMode

int albaVMEIterator::m_TraversalMode
protected

Definition at line 129 of file albaVMEIterator.h.

◆ m_TraversalDone

int albaVMEIterator::m_TraversalDone
protected

Definition at line 130 of file albaVMEIterator.h.

◆ m_IgnoreVisibleToTraverse

bool albaVMEIterator::m_IgnoreVisibleToTraverse
protected

Definition at line 131 of file albaVMEIterator.h.

◆ m_CurrentIdx

albaVector<albaID> albaVMEIterator::m_CurrentIdx
protected

Definition at line 133 of file albaVMEIterator.h.


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