#include <scannerConnectors.hh>
Public Member Functions | |
Joiner (const T &val, Joiner *lnk=0) | |
~Joiner () | |
Joiner *& | operator[] (uint i) |
T & | value () |
Returns the content of the container. | |
Static Public Member Functions | |
static void | destructor (Joiner< T, nlnk > *&j, bool values=true) |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Joiner< T, nlnk > &j) |
Joiner class with multiple successors, i.e. it can represent a b-ary tree with b=nlnk. A Joiner is a node in this tree. with b=1 the tree degraded to a forward linked list.
Adding a new node at the beginning of the list is as easy as
Joiner<int, 1>* list; int a = 2; list = new Joiner<int, 1>(a, list);
It is not possible to use unique_ptr and Joiner together in a construction like
unique_ptr<Joiner<int, 1> > list;
though. The assignment operator = of unique_ptr releases (ie. deletes) the old object when a new object is assigned. In the statement above, the list on the right hand side would be deleted...
T | Class to be stored |
nlnk | Number of successors (ie. links) |
Definition at line 73 of file scannerConnectors.hh.
|
inline |
Constructor. Fills the container and sets the successors to default of NULL. If a successor is given as argument its filled in as the last successor.
val | Content of the container. |
lnk | Initialization value for the last successor. |
Definition at line 125 of file scannerConnectors.hh.
|
inline |
Empty destructor. To delete the list/tree do it by hand or use destructor (only if T pointer).
Definition at line 88 of file scannerConnectors.hh.
Static function to delete the list/tree. This Function is only valid if T is a pointer type allocated with new().
j | Root of the list/tree. It is overwritten with 0 |
Definition at line 135 of file scannerConnectors.hh.
|
inline |
Index operator for the container.
Definition at line 101 of file scannerConnectors.hh.
|
inline |
Returns the content of the container.
Definition at line 107 of file scannerConnectors.hh.
Definition at line 161 of file scannerConnectors.hh.