8#ifndef INCLUDED_BSLALG_RBTREENODE
9#define INCLUDED_BSLALG_RBTREENODE
345#include <bslscm_version.h>
503#if defined(BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC) && \
504 !defined(BSLS_PLATFORM_CMP_CLANG)
505#pragma GCC diagnostic push
506#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
511#if defined(BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC) && \
512 !defined(BSLS_PLATFORM_CMP_CLANG)
513#pragma GCC diagnostic pop
527 d_parentWithColor_p = toNode(toInt(d_parentWithColor_p) | 0x01);
533 d_parentWithColor_p = toNode(toInt(d_parentWithColor_p) & ~0x01);
541 d_parentWithColor_p =
542 toNode(toInt(address) | (toInt(d_parentWithColor_p) & 0x01));
560 d_parentWithColor_p = toNode((toInt(d_parentWithColor_p) & ~0x01) | value);
569 d_parentWithColor_p = toNode(toInt(d_parentWithColor_p) ^ 0x01);
580 d_parentWithColor_p = toNode(toInt(
parent) |
color);
588 return toNode(toInt(d_parentWithColor_p) & ~0x01);
607 return toNode(toInt(d_parentWithColor_p) & ~0x01);
613 return toInt(d_parentWithColor_p) & 0x01;
637 return static_cast<Color>(toInt(d_parentWithColor_p) & 0x01);
Definition bslalg_rbtreenode.h:376
RbTreeNode & operator=(const RbTreeNode &rhs)=default
RbTreeNode * rightChild()
Definition bslalg_rbtreenode.h:598
void toggleColor()
Definition bslalg_rbtreenode.h:564
RbTreeNode * leftChild()
Definition bslalg_rbtreenode.h:592
void reset(RbTreeNode *parent, RbTreeNode *leftChild, RbTreeNode *rightChild, Color color)
Definition bslalg_rbtreenode.h:573
bool isRed() const
Return true if this node is red.
Definition bslalg_rbtreenode.h:617
void setRightChild(RbTreeNode *address)
Definition bslalg_rbtreenode.h:552
void makeRed()
Definition bslalg_rbtreenode.h:531
void makeBlack()
Definition bslalg_rbtreenode.h:525
void setParent(RbTreeNode *address)
Definition bslalg_rbtreenode.h:537
Color color() const
Return the color of this node.
Definition bslalg_rbtreenode.h:635
bool isBlack() const
Return true if this node is black.
Definition bslalg_rbtreenode.h:611
void setLeftChild(RbTreeNode *address)
Definition bslalg_rbtreenode.h:546
void setColor(Color value)
Set the color of this node to the specified value.
Definition bslalg_rbtreenode.h:558
RbTreeNode * parent()
Definition bslalg_rbtreenode.h:586
Color
Definition bslalg_rbtreenode.h:380
@ BSLALG_BLACK
Definition bslalg_rbtreenode.h:382
@ BSLALG_RED
Definition bslalg_rbtreenode.h:381
RbTreeNode(const RbTreeNode &original)=default
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlc_flathashmap.h:1805
std::size_t UintPtr
Definition bsls_types.h:126