ORIGINAL
|
Internal node type for hash table storage. More...
#include <hashTable.h>
Public Member Functions | |
hashNode (const K_TYPE &key=K_TYPE{}, const V_TYPE &value=V_TYPE{}, hashNode *next=nullptr) | |
Constructs a new hash node. | |
hashNode (const hashNode &other) | |
Copy constructor. | |
hashNode & | operator= (const hashNode &other) |
Copy assignment operator. | |
couple< const K_TYPE, V_TYPE > & | getVal () override |
Gets key-value pair (non-const) | |
const couple< const K_TYPE, V_TYPE > & | getVal () const override |
Gets key-value pair (const) | |
const K_TYPE & | getKey () const |
Gets the key (const) | |
const V_TYPE & | getValue () const |
Gets the value (const) | |
V_TYPE & | getValue () |
Gets the value (non-const) | |
void | setVal (couple< const K_TYPE, V_TYPE > data) override |
Not supported (throws unSupportedMethodError) | |
void | setValue (const V_TYPE &value) |
Sets a new value. | |
hashNode * | getPPrev () const override |
Not supported (throws unSupportedMethodError) | |
hashNode * | getPNext () const override |
Gets next node in chain. | |
void | setPNext (hashNode *new_next) |
Sets next node in chain. | |
![]() | |
~wrapper () override=default | |
Destructor for the wrapper class. | |
std::string | className () const override |
Provides class identifier for diagnostics. See original::printable::className() | |
std::string | toString (bool enter) const override |
Generates formatted diagnostic string. See original::printable::toString() | |
![]() | |
operator std::string () const | |
Explicit conversion to std::string. | |
operator const char * () const | |
Explicit conversion to C-style string. | |
const char * | toCString (bool enter) const |
Direct C-string access with formatting control. | |
template<typename TYPE > | |
auto | formatString (const TYPE &t) -> std::string |
template<typename TYPE > | |
auto | formatCString (const TYPE &t) -> const char * |
template<typename TYPE > | |
auto | formatEnum (const TYPE &t) -> std::string |
template<typename TYPE > | |
auto | formatString (TYPE *const &ptr) -> std::string |
Static Public Member Functions | |
static void | connect (hashNode *prev, hashNode *next) |
Connects two nodes in chain. | |
![]() | |
template<typename TYPE > | |
static std::string | formatString (const TYPE &t) |
Universal value-to-string conversion with type-specific formatting. | |
template<Printable TYPE> | |
static std::string | formatString (const TYPE &t) |
Specialization for types deriving from printable. | |
template<EnumType TYPE> | |
static std::string | formatString (const TYPE &t) |
Specialization for enum types with type-safe formatting. | |
template<typename TYPE > | |
static std::string | formatString (TYPE *const &ptr) |
Pointer-specific formatting with null safety. | |
template<typename TYPE > | |
static const char * | formatCString (const TYPE &t) |
C-string cache for temporary usage with static storage. | |
template<typename TYPE > | |
static std::string | formatEnum (const TYPE &t) |
Enum formatting utility with underlying value extraction. | |
template<> | |
auto | formatString (const char &t) -> std::string |
template<> | |
auto | formatString (const bool &t) -> std::string |
template<> | |
auto | formatString (const char *const &ptr) -> std::string |
Internal node type for hash table storage.
Wraps key-value pairs and maintains chain links for separate chaining. Each node contains:
The class provides:
|
explicit |
Constructs a new hash node.
key | Key to store (const reference) |
value | Value to associate |
next | Next node in chain (nullptr if end of chain) |
Copy constructor.
other | Node to copy from |
|
static |
Connects two nodes in chain.
prev | Previous node in chain |
next | Next node in chain |
Gets the key (const)
|
overridevirtual |
Gets next node in chain.
Implements original::wrapper< couple< const K_TYPE, V_TYPE > >.
|
overridevirtual |
Not supported (throws unSupportedMethodError)
Implements original::wrapper< couple< const K_TYPE, V_TYPE > >.
|
overridevirtual |
Gets key-value pair (const)
Implements original::wrapper< couple< const K_TYPE, V_TYPE > >.
|
overridevirtual |
Gets key-value pair (non-const)
Implements original::wrapper< couple< const K_TYPE, V_TYPE > >.
Gets the value (non-const)
Gets the value (const)
original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode & original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode::operator= | ( | const hashNode & | other | ) |
Copy assignment operator.
other | Node to copy from |
Sets next node in chain.
new_next | New next node to set |
|
overridevirtual |
Not supported (throws unSupportedMethodError)
Implements original::wrapper< couple< const K_TYPE, V_TYPE > >.
Sets a new value.
value | New value to set |