ORIGINAL
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
original::tuple< TYPES > Class Template Referencefinal

Container for multiple heterogeneous elements. More...

#include <tuple.h>

Inheritance diagram for original::tuple< TYPES >:
Inheritance graph
Collaboration diagram for original::tuple< TYPES >:
Collaboration graph

Public Member Functions

 tuple (TYPES &&... e)
 
 tuple (const tuple &other)
 
tupleoperator= (const tuple &other)
 
 tuple (tuple &&other) noexcept
 
tupleoperator= (tuple &&other) noexcept
 
template<u_integer IDX>
const auto & get () const
 
template<u_integer IDX>
auto & get ()
 
template<u_integer IDX, typename E >
tupleset (const E &e)
 
template<u_integer BEGIN_IDX, u_integer N_ELEMS>
auto slice () const
 
integer compareTo (const tuple &other) const override
 
std::string toString (bool enter) const override
 Generates formatted string representation.
 
std::string className () const override
 Gets the class name for type identification.
 
template<typename... O_TYPES, original::u_integer... T_SIZE, original::u_integer... O_SIZE>
original::tuple< TYPES..., O_TYPES... > _concat (const tuple< O_TYPES... > &other, std::integer_sequence< u_integer, T_SIZE... >, std::integer_sequence< u_integer, O_SIZE... >) const
 
template<typename... O_TYPES, original::u_integer... T_SIZE, original::u_integer... O_SIZE>
original::tuple< TYPES..., O_TYPES... > _concat (tuple< O_TYPES... > &&other, std::integer_sequence< u_integer, T_SIZE... >, std::integer_sequence< u_integer, O_SIZE... >) const
 
template<original::u_integer IDX, typename E >
original::tuple< TYPES... > & set (const E &e)
 
- 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 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
 
- Public Member Functions inherited from original::comparable< tuple< TYPES... > >
virtual integer compareTo (const tuple< TYPES... > &other) const=0
 Compares the current object with another of the same type.
 
bool operator== (const tuple< TYPES... > &other) const
 Checks if the current object is equal to another.
 
bool operator!= (const tuple< TYPES... > &other) const
 Checks if the current object is not equal to another.
 
bool operator< (const tuple< TYPES... > &other) const
 Checks if the current object is less than another.
 
bool operator> (const tuple< TYPES... > &other) const
 Checks if the current object is greater than another.
 
bool operator<= (const tuple< TYPES... > &other) const
 Checks if the current object is less than or equal to another.
 
bool operator>= (const tuple< TYPES... > &other) const
 Checks if the current object is greater than or equal to another.
 
virtual ~comparable ()=default
 Virtual destructor for proper cleanup of derived objects.
 

Static Public Member Functions

static consteval u_integer size () noexcept
 
- Static Public Member Functions inherited from original::printable
template<typename TYPE >
static std::string formatString (const TYPE &t)
 Universal value-to-string conversion.
 
template<Printable TYPE>
static std::string formatString (const TYPE &t)
 Specialization for printable types.
 
template<EnumType TYPE>
static std::string formatString (const TYPE &t)
 Specialization for enum types.
 
template<typename TYPE >
static std::string formatString (TYPE *const &ptr)
 Pointer-specific formatting.
 
template<typename TYPE >
static const char * formatCString (const TYPE &t)
 C-string cache for temporary usage.
 
template<typename TYPE >
static std::string formatEnum (const TYPE &t)
 Enum formatting utility.
 
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
 

Friends

template<typename F_TYPE , typename S_TYPE >
tuple< F_TYPE, S_TYPE > makeTuple (const couple< F_TYPE, S_TYPE > &cp)
 
template<typename F_TYPE , typename S_TYPE >
tuple< F_TYPE, S_TYPE > makeTuple (couple< F_TYPE, S_TYPE > &&cp)
 
template<typename... L_TYPES, typename... R_TYPES>
tuple< L_TYPES..., R_TYPES... > operator+ (const tuple< L_TYPES... > &lt, const tuple< R_TYPES... > &rt)
 
template<typename... L_TYPES, typename... R_TYPES>
tuple< L_TYPES..., R_TYPES... > operator+ (tuple< L_TYPES... > &&lt, const tuple< R_TYPES... > &&rt)
 
template<typename... L_TYPES, typename... R_TYPES>
tuple< L_TYPES..., R_TYPES... > operator+ (tuple< L_TYPES... > &&lt, const tuple< R_TYPES... > &rt)
 
template<typename... L_TYPES, typename... R_TYPES>
tuple< L_TYPES..., R_TYPES... > operator+ (const tuple< L_TYPES... > &lt, tuple< R_TYPES... > &&rt)
 

Detailed Description

template<typename... TYPES>
class original::tuple< TYPES >

Container for multiple heterogeneous elements.

Template Parameters
TYPESVariadic template parameter list of element types

Stores a sequence of elements with type safety. Provides:

Examples
/home/runner/work/original/original/src/core/tuple.h.

Member Function Documentation

◆ className()

template<typename... TYPES>
std::string original::tuple< TYPES >::className ( ) const
overridevirtual

Gets the class name for type identification.

Returns
Class name as string.

Override in derived classes to provide accurate type names.

class MyClass : public printable {
std::string className() const override { return "MyClass"; }
};
Base class providing polymorphic string conversion capabilities.
Definition printable.h:39

Reimplemented from original::printable.

Examples
/home/runner/work/original/original/src/core/tuple.h.

◆ toString()

template<typename... TYPES>
std::string original::tuple< TYPES >::toString ( bool  enter) const
overridevirtual

Generates formatted string representation.

Parameters
enterWhether to append newline.
Returns
Formatted string in "ClassName(data)" format.
MyClass obj;
std::cout << obj.toString(true); // Outputs "printable(@0x7ffd) \n"

Reimplemented from original::printable.

Examples
/home/runner/work/original/original/src/core/tuple.h.

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