///
/// \param mem_sgmt The \c MemorySegment that allocated memory for
/// \c rbnode.
- /// \param ztable A non NULL pointer to a valid \c RBNode object
+ /// \param rbnode A non NULL pointer to a valid \c RBNode object
/// that was originally created by the \c create() method (the behavior
/// is undefined if this condition isn't met).
static void destroy(util::MemorySegment& mem_sgmt, RBNode<T>* rbnode) {
}
/// TBD
- const void* getLabelsData() const {
- return (this + 1);
- }
+ const void* getLabelsData() const { return (this + 1); }
/// TBD
- void* getLabelsData() {
- return (this + 1);
- }
+ void* getLabelsData() { return (this + 1); }
public:
/// \brief Alias for shared pointer to the data.
*
* the tree will look like:
* \verbatim
+ .
+ |
b
/ \
a d.e.f
\endverbatim
* \todo
* - add remove interface
- * - add iterator to iterate over the whole \c RBTree. This may be necessary,
- * for example, to support AXFR.
*/
template <typename T>
class RBTree : public boost::noncopyable {
}
indent(os, depth);
- os << node->getName().toText() << " ("
- << ((node->getColor() == RBNode<T>::BLACK) ? "black" : "red") << ")";
+ os << node->getLabels() << " ("
+ << ((node->getColor() == RBNode<T>::BLACK) ? "black" : "red")
+ << ")";
if (node->isEmpty()) {
os << " [invisible]";
}
const RBNode<T>* down = node->getDown();
if (down != NULLNODE) {
indent(os, depth + 1);
- os << "begin down from " << node->getName().toText() << "\n";
+ os << "begin down from " << node->getLabels() << "\n";
dumpTreeHelper(os, down, depth + 1);
indent(os, depth + 1);
- os << "end down from " << node->getName().toText() << "\n";
+ os << "end down from " << node->getLabels() << "\n";
}
dumpTreeHelper(os, node->getLeft(), depth + 1);
dumpTreeHelper(os, node->getRight(), depth + 1);
str2 << "tree has 15 node(s)\n"
". (black) [invisible] [subtreeroot]\n"
" begin down from .\n"
- " b. (black) [subtreeroot]\n"
- " a. (black)\n"
+ " b (black) [subtreeroot]\n"
+ " a (black)\n"
" NULL\n"
" NULL\n"
- " d.e.f. (black) [invisible]\n"
- " begin down from d.e.f.\n"
- " w.y. (black) [invisible] [subtreeroot]\n"
- " begin down from w.y.\n"
- " p. (black) [subtreeroot]\n"
- " o. (red)\n"
+ " d.e.f (black) [invisible]\n"
+ " begin down from d.e.f\n"
+ " w.y (black) [invisible] [subtreeroot]\n"
+ " begin down from w.y\n"
+ " p (black) [subtreeroot]\n"
+ " o (red)\n"
" NULL\n"
" NULL\n"
- " q. (red)\n"
+ " q (red)\n"
" NULL\n"
" NULL\n"
- " end down from w.y.\n"
- " x. (red)\n"
+ " end down from w.y\n"
+ " x (red)\n"
" NULL\n"
" NULL\n"
- " z. (red)\n"
- " begin down from z.\n"
- " j. (black) [subtreeroot]\n"
+ " z (red)\n"
+ " begin down from z\n"
+ " j (black) [subtreeroot]\n"
" NULL\n"
" NULL\n"
- " end down from z.\n"
+ " end down from z\n"
" NULL\n"
" NULL\n"
- " end down from d.e.f.\n"
- " c. (red)\n"
+ " end down from d.e.f\n"
+ " c (red)\n"
" NULL\n"
" NULL\n"
- " g.h. (red)\n"
- " begin down from g.h.\n"
- " i. (black) [subtreeroot]\n"
+ " g.h (red)\n"
+ " begin down from g.h\n"
+ " i (black) [subtreeroot]\n"
" NULL\n"
- " k. (red)\n"
+ " k (red)\n"
" NULL\n"
" NULL\n"
- " end down from g.h.\n"
+ " end down from g.h\n"
" NULL\n"
" NULL\n"
" end down from .\n"