ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
original::wrapper< TYPE > Class Template Referenceabstract

Base class for linked value containers with formatted output. More...

#include <wrapper.h>

Inheritance diagram for original::wrapper< TYPE >:
Inheritance graph
Collaboration diagram for original::wrapper< TYPE >:
Collaboration graph

Public Member Functions

virtual TYPEgetVal ()=0
 Accesses the contained value (mutable).
 
virtual const TYPEgetVal () const =0
 Accesses the contained value (immutable).
 
virtual void setVal (TYPE data)=0
 Updates the contained value.
 
virtual wrappergetPPrev () const =0
 Retrieves previous node in container sequence.
 
virtual wrappergetPNext () const =0
 Retrieves next node in container sequence.
 
 ~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()
 
- Public Member Functions inherited from original::printable
 operator std::string () const
 Explicit conversion to std::string.
 
 operator const char * () const
 Explicit conversion to C-style string.
 
const chartoCString (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
 

Additional Inherited Members

- Static Public Member Functions inherited from original::printable
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 charformatCString (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
 

Detailed Description

template<typename TYPE>
class original::wrapper< TYPE >

Base class for linked value containers with formatted output.

Template Parameters
TYPEType of encapsulated value

Combines three core capabilities:

  1. Value storage and access
  2. Node navigation
  3. Polymorphic string representation through printable interface

Constructor & Destructor Documentation

◆ ~wrapper()

template<typename TYPE >
original::wrapper< TYPE >::~wrapper ( )
overridedefault

Destructor for the wrapper class.

The destructor ensures proper cleanup of the object. Since wrapper is an abstract base class, the destructor is virtual to allow derived classes to perform their own cleanup as needed before the base class destructor is invoked.

Member Function Documentation

◆ className()

template<typename TYPE >
auto original::wrapper< TYPE >::className ( ) const
overridevirtual

Provides class identifier for diagnostics. See original::printable::className()

Base implementation returns "wrapper".

class my_wrapper : public wrapper<int> {
std::string className() const override { return "my_wrapper"; }
};
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37
Base class for linked value containers with formatted output.
Definition wrapper.h:28

Reimplemented from original::printable.

◆ getPNext()

template<typename TYPE >
virtual wrapper * original::wrapper< TYPE >::getPNext ( ) const
pure virtual

Retrieves next node in container sequence.

Returns
Pointer to successor node or nullptr if last element.

Implemented in original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode.

◆ getPPrev()

template<typename TYPE >
virtual wrapper * original::wrapper< TYPE >::getPPrev ( ) const
pure virtual

Retrieves previous node in container sequence.

Returns
Pointer to predecessor node or nullptr if first element.

Implemented in original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode.

◆ getVal() [1/2]

template<typename TYPE >
virtual const TYPE & original::wrapper< TYPE >::getVal ( ) const
pure virtual

Accesses the contained value (immutable).

Returns
Const reference to the stored value.

Implemented in original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode.

◆ getVal() [2/2]

template<typename TYPE >
virtual TYPE & original::wrapper< TYPE >::getVal ( )
pure virtual

Accesses the contained value (mutable).

Returns
Reference to the stored value.

Implemented in original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode.

◆ setVal()

template<typename TYPE >
virtual void original::wrapper< TYPE >::setVal ( TYPE  data)
pure virtual

Updates the contained value.

Parameters
dataNew value to store.
Postcondition
getVal() == data

Implemented in original::hashTable< K_TYPE, V_TYPE, ALLOC, HASH >::hashNode.

◆ toString()

template<typename TYPE >
auto original::wrapper< TYPE >::toString ( bool  enter) const
overridevirtual

Generates formatted diagnostic string. See original::printable::toString()

Parameters
enterAdd trailing newline when true.
Returns
String in format "ClassName(address, value)".
std::cout << w->toString(true); // "wrapper(@0x1234, 42)\n"
std::string toString(bool enter) const override
String representation formatter.
Definition autoPtr.h:724

Reimplemented from original::printable.


The documentation for this class was generated from the following file: