5 #include <libutl/Object.h> 67 return (_object ==
nullptr);
74 return ((_parent !=
nullptr) && (_parent->_left ==
this));
81 return ((_parent !=
nullptr) && (_parent->_right ==
this));
88 return (_parent ==
nullptr);
146 virtual void addFixup() = 0;
149 virtual void removeFixup(
const BinTreeNode* removedNode) = 0;
164 _object =
const_cast<Object*
>(object);
172 _left->_parent =
this;
180 _right->_parent =
this;
bool isLeftChild() const
Determine whether self is a left child.
bool isRightChild() const
Determine whether self is a right child.
#define const_cast_this
Pointer to the object the method was invoked on (casting away const).
void deInit()
De-initialize UTL++.
void setRight(BinTreeNode *node)
Set the right child.
BinTreeNode * parent() const
Return the parent node (nullptr if root).
const BinTreeNode * leftMost() const
Return the left-most child (smallest node reachable from self).
BinTreeNode()
Constructor.
void setLeft(BinTreeNode *node)
Set the left child.
virtual ~BinTreeNode()
Destructor.
BinTreeNode(const Object *object)
Constructor.
BinTreeNode * right() const
Return the right child.
bool isLeaf() const
Determine whether self is a leaf node.
unsigned int uint_t
Unsigned integer.
bool isRoot() const
Determine whether self is the root node.
BinTreeNode * left() const
Return the left child.
Root of UTL++ class hierarchy.
void dump(const FwdIt &begin, const FwdIt &end, Stream &os, uint_t level=uint_t_max, bool key=false, bool printClassName=false, uint_t indent=0, const char *separator=nullptr)
Dump objects to the given stream (with Object::dump()).
void init()
Initialize UTL++.
const BinTreeNode * rightMost() const
Return the right-most child (largest node reachable from self).