B-Tree set template definition. More...
#include <tbtreeset.h>
Public Member Functions | |
TBTreeSet (int32 order=3) | |
Default constructor. | |
TBTreeSet (const TBTreeSet< T > &set) | |
Copy constructor. | |
TBTreeSet (const TContainer< T > &container) | |
Construct a set from the elements of the container. | |
~TBTreeSet () | |
Destructor. | |
TBTreeSet< T > & | operator= (const TBTreeSet< T > &set) |
Assignment operator. | |
TBTreeSet< T > | operator- (const TBTreeSet< T > &set) const |
Set difference. | |
TBTreeSet< T > | operator& (const TBTreeSet< T > &set) const |
Set intersection. | |
TBTreeSet< T > | operator| (const TBTreeSet< T > &set) const |
Set union. | |
bool | add (const T &item) |
Add item to set. |
B-Tree set template definition.
TBTreeSet is a template class for managing unique items in a TBTree. Every item can only be inserted once in the set. For more information about TBTree (which should not be confused with a "binary tree", which is in tbinarytree.h) see the tbtree.h header.
TBTreeSet | ( | int32 | order = 3 |
) | [inline] |
Default constructor.
"TBTreeSet" is the default set constructor.
order | the order of the B-Tree is the maximum number of children for each node. Order has to be >= 3. |
TBTreeSet | ( | const TContainer< T > & | container | ) | [inline] |
Construct a set from the elements of the container.
Constructs a TBTreeSet of order 3 from the specified container by copying all elements of the container into the set. Elements, that appear multiple times in the container will only be once in the set.
container | the source container. |
~TBTreeSet | ( | ) | [inline] |
Destructor.
Assignment operator.
Assignment operator copies the specified set into this set.
Reimplemented from TBTree< T >.
Set difference.
"-" difference operator returns a set containing those items, that appear in this set, but that have no equal in the specified set.
set | the set that will be subtracted from this |
Set intersection.
"&" intersection operator returns a set containing only those items, that appear in this set and the input set.
set | the set that will be intersected with this |
Set union.
"|" union operator returns a set containing those items, that appear in this set or the input set or both sets.
set | the set that will be unified with this. |
bool add | ( | const T & | item | ) | [inline, virtual] |
Add item to set.
"add" adds a new item to this set. If it would be a duplicate, nothing is added.
item | the item to add |
Reimplemented from TBTree< T >.