ORIGINAL
|
Internal node class for Skip List. More...
#include <skipList.h>
Public Member Functions | |
skipListNode (const K_TYPE &key=K_TYPE{}, const V_TYPE &value=V_TYPE{}, u_integer levels=1, std::initializer_list< skipListNode * > next={}) | |
Constructs a new skipListNode. | |
couple< const K_TYPE, V_TYPE > & | getVal () |
Gets key-value pair (non-const) | |
const couple< const K_TYPE, V_TYPE > & | getVal () const |
Gets key-value pair (const) | |
const K_TYPE & | getKey () const |
Gets key. | |
const V_TYPE & | getValue () const |
Gets value (const) | |
V_TYPE & | getValue () |
Gets value (non-const) | |
u_integer | getLevels () const |
Gets number of levels for this node. | |
void | expandLevels (u_integer new_levels) |
Expands node to more levels. | |
void | shrinkLevels (u_integer new_levels) |
Shrinks node to fewer levels. | |
void | setValue (const V_TYPE &value) |
Sets new value. | |
skipListNode * | getPNext (u_integer levels) const |
Gets next node at specified level. | |
void | setPNext (u_integer levels, skipListNode *next) |
Sets next node at specified level. | |
Static Public Member Functions | |
static void | connect (u_integer levels, skipListNode *prev, skipListNode *next) |
Connects two nodes at specified level. | |
Friends | |
class | skipList |
Internal node class for Skip List.
Represents a single node in the list with:
|
explicit |
Constructs a new skipListNode.
key | Key to store |
value | Value to store |
levels | Number of levels for this node |
next | Initializer list of next pointers |
|
static |
Connects two nodes at specified level.
levels | Level to connect at (1-based) |
prev | Previous node |
next | Next node |
void original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::expandLevels | ( | original::u_integer | new_levels | ) |
Expands node to more levels.
new_levels | New total number of levels |
const K_TYPE & original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::getKey | ( | ) | const |
Gets key.
|
nodiscard |
Gets number of levels for this node.
original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode * original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::getPNext | ( | u_integer | levels | ) | const |
Gets next node at specified level.
levels | Level to query (1-based) |
original::couple< const K_TYPE, V_TYPE > & original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::getVal | ( | ) |
Gets key-value pair (non-const)
const original::couple< const K_TYPE, V_TYPE > & original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::getVal | ( | ) | const |
Gets key-value pair (const)
V_TYPE & original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::getValue | ( | ) |
Gets value (non-const)
const V_TYPE & original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::getValue | ( | ) | const |
Gets value (const)
void original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::setPNext | ( | u_integer | levels, |
skipListNode * | next ) |
Sets next node at specified level.
levels | Level to modify (1-based) |
next | New next node to set |
void original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::setValue | ( | const V_TYPE & | value | ) |
Sets new value.
value | New value to set |
void original::skipList< K_TYPE, V_TYPE, ALLOC, Compare >::skipListNode::shrinkLevels | ( | original::u_integer | new_levels | ) |
Shrinks node to fewer levels.
new_levels | New total number of levels |