A simple Tree.
More...
#include "<SaS/Common/Tree.hpp>"
A simple Tree.
Definition at line 100 of file Tree.hpp.
◆ TCMP_t
SoftwareAndServices::Library::Common::Tree::TCMP_t |
Signature for compare routine.
- Parameters
-
One | The first item to compare. |
Two | The second item to compare. |
- Returns
- Zero if they are equal, else < 0 if One is less than two and > 0 if Two is more than One.
Definition at line 116 of file Tree.hpp.
◆ Tree()
SoftwareAndServices::Library::Common::Tree::Tree |
( |
| ) |
|
Tree - Default Constructor.
◆ ~Tree()
virtual SoftwareAndServices::Library::Common::Tree::~Tree |
( |
| ) |
|
|
virtual |
◆ Find()
virtual Tree* SoftwareAndServices::Library::Common::Tree::Find |
( |
Tree * |
Root, |
|
|
const void * |
ToFind, |
|
|
TCMP_t |
CmpFunction |
|
) |
| |
|
pure virtual |
Find element in Tree.
- Parameters
-
Root | Start of where to look. |
ToFind | What to find. |
CmpFunction | Routine to use as compare. |
- Returns
- The node, or nullptr if none.
◆ Insert()
virtual bool SoftwareAndServices::Library::Common::Tree::Insert |
( |
Tree ** |
Root, |
|
|
const Tree * |
NewData, |
|
|
int |
Cmpconst Tree *One, const Tree *Two |
|
) |
| |
|
pure virtual |
Insert node into Tree.
- Parameters
-
Root | Start of Tree to use. |
NewData | The new data to add. |
Cmp | The name of the compare routine to use. |
- Returns
- TRUE if inserted.
◆ Remove()
virtual bool SoftwareAndServices::Library::Common::Tree::Remove |
( |
Tree ** |
Root, |
|
|
const Tree * |
ToRemove, |
|
|
int |
Cmpconst Tree *One, const Tree *Two |
|
) |
| |
|
pure virtual |
Remove an element from the Tree.
- Parameters
-
Root | Top of the Tree to use. |
ToRemove | The node value to remove. |
Cmp | The name of the compare function. |
- Returns
- TRUE if found and removed.
◆ Walk()
virtual void SoftwareAndServices::Library::Common::Tree::Walk |
( |
const Tree * |
Root, |
|
|
WALK_t |
WalkFunction |
|
) |
| |
|
pure virtual |
Walk the Tree and apply WalkFunction.
- Parameters
-
Root | The top of the Tree to walk. |
WalkFunction | The name of the function to apply to each found node. |
◆ _Data
void* SoftwareAndServices::Library::Common::Tree::_Data |
|
protected |
The data in the node.
Definition at line 191 of file Tree.hpp.
The documentation for this class was generated from the following file: