|
Base Module
VST 3.6.5
SDK for developing VST Plug-in
|
TBinaryTree is a rooted binary tree. More...
#include <tbinarytree.h>
Inheritance diagram for TBinaryTree< T >:Public Member Functions | |
| TBinaryTree () | |
| Default constructor. More... | |
| TBinaryTree (const TBinaryTree< T > &) | |
| Copy constructor. More... | |
| TBinaryTree (const TContainer< T > &) | |
| Construct from container. More... | |
| ~TBinaryTree () | |
| Tree destructor. More... | |
| virtual TContainer< T > * | newInstance () const |
| TBinaryTree< T > & | operator= (const TBinaryTree< T > &) |
| Assignment. More... | |
| virtual bool | add (const T &) |
| Add item to tree. More... | |
| virtual bool | remove (const T &) |
| Remove item from tree. More... | |
| virtual bool | remove (const TIterator< T > &) |
| Remove iterator item. More... | |
| virtual bool | removeAt (int32 index) |
| Remove item at index. More... | |
| virtual void | removeAll () |
| Remove all items. More... | |
| const T & | root () const |
| Return root tree item. More... | |
| void | balance () |
| Balance the tree. More... | |
| virtual T & | lookup (const T &) const |
| Find equal item in tree. More... | |
| virtual bool | contains (const T &) const |
| Is equal item in tree? More... | |
| virtual int32 | occurrences (const T &) const |
| Count occurrences of item. More... | |
| TIterator< T > * | newIterator () const |
| Get tree iterator. More... | |
Public Member Functions inherited from TContainer< T > | |
| TContainer () | |
| TContainer (const TContainer< T > &) | |
| virtual | ~TContainer () |
| bool | operator== (const TContainer< T > &) const |
| bool | operator!= (const TContainer< T > &) const |
| T & | operator[] (int32) const |
| "[]" indexing operator returns the item at the specified index. More... | |
| virtual int32 | total () const |
| Return number of items. More... | |
| virtual bool | isEmpty () const |
| Is container empty? More... | |
| virtual int32 | size () const |
| Returns the container size. More... | |
| virtual T & | at (int32 index) const |
| Get item at index. More... | |
| TContainer< T > * | lookupAll (const T &item) const |
| Allocate and returns a container with all items in this container equal to the specified item. More... | |
| bool | addAllFrom (const TContainer< T > &container) |
| Adds all the items from the specified container to this container. More... | |
| bool | addNewFrom (const TContainer< T > &container) |
| Adds the items from the specified container to this container that are not in this container already. More... | |
| T & | error () const |
| Access error object. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from TContainer< T > | |
| void | copy (const TContainer< T > &container) |
| Internal copy method. Copies the contents of the specified container into this container. More... | |
Protected Attributes inherited from TContainer< T > | |
| T | errorObject |
| Object used as return value when methods returning a T& fail. More... | |
| int32 | _size |
| Container size. More... | |
TBinaryTree is a rooted binary tree.
From wikipedia: A binary tree is a connected acyclic graph such that the degree of each vertex is no more than 3. It can be shown that in any binary tree, there are exactly two more nodes of degree one than there are of degree three, but there can be any number of nodes of degree two. A rooted binary tree is such a graph that has one of its vertices of degree no more than 2 singled out as the root.
| TBinaryTree | ( | ) |
Default constructor.
| TBinaryTree | ( | const TBinaryTree< T > & | ) |
Copy constructor.
| TBinaryTree | ( | const TContainer< T > & | ) |
Construct from container.
| ~TBinaryTree | ( | ) |
Tree destructor.
|
virtual |
Implements TContainer< T >.
| TBinaryTree<T>& operator= | ( | const TBinaryTree< T > & | ) |
Assignment.
|
virtual |
Add item to tree.
Implements TContainer< T >.
|
virtual |
Remove item from tree.
Implements TContainer< T >.
|
virtual |
Remove iterator item.
Implements TContainer< T >.
|
virtual |
Remove item at index.
Implements TContainer< T >.
|
virtual |
Remove all items.
Implements TContainer< T >.
| const T& root | ( | ) | const |
Return root tree item.
| void balance | ( | ) |
Balance the tree.
|
virtual |
Find equal item in tree.
Reimplemented from TContainer< T >.
|
virtual |
Is equal item in tree?
Reimplemented from TContainer< T >.
|
virtual |
Count occurrences of item.
Reimplemented from TContainer< T >.
|
virtual |
Get tree iterator.
Implements TContainer< T >.