Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions
ext::ptr_tuple< Types > Class Template Reference

Implementation of tuple storing dynamicaly allocated instances of given type. The class mimicks the iterface of the standard library tuple, but effectively allows polymorphic objects to be stored inside. More...

#include <ptr_tuple.hpp>

Public Member Functions

 ptr_tuple (const ptr_tuple &tpl)
 The copy constructor of the pointer tuple. More...
 
 ptr_tuple (ptr_tuple &&tpl)
 The move constructor of the pointer tuple. More...
 
template<class ... UTypes>
 ptr_tuple (UTypes &&... elems)
 Tuple constructor from pack of source values. More...
 
 ~ptr_tuple ()
 The pointer tuple destructor. More...
 
ptr_tuple< Types ... > & operator= (const ptr_tuple< Types ... > &other)
 The pointer tuple copy operator of assignemnt. More...
 
ptr_tuple< Types ... > & operator= (ptr_tuple< Types ... > &&other)
 The pointer tuple move operator of assignemnt. More...
 
void swap (ptr_tuple &other)
 Swaps two instances of pointer tuple. More...
 
template<std::size_t I>
auto & get () &
 Access method to inside the pointer tuple. More...
 
template<std::size_t I>
const auto & get () const &
 Access method to inside the pointer tuple. More...
 
template<std::size_t I>
auto && get () &&
 Access method to inside the pointer tuple. More...
 
template<class R , std::size_t I>
void set (R &&value)
 Setter method of a value inside the pointer tuple. More...
 
bool operator== (const ext::ptr_tuple< Types ... > &second) const
 Specialisation of the compare structure implementing the three-way comparison. More...
 
auto operator<=> (const ext::ptr_tuple< Types ... > &second) const
 Specialisation of the compare structure implementing the three-way comparison. More...
 

Detailed Description

template<class ... Types>
class ext::ptr_tuple< Types >

Implementation of tuple storing dynamicaly allocated instances of given type. The class mimicks the iterface of the standard library tuple, but effectively allows polymorphic objects to be stored inside.

Template Parameters
Types... the types inside the tuple

Constructor & Destructor Documentation

◆ ptr_tuple() [1/3]

template<class ... Types>
ext::ptr_tuple< Types >::ptr_tuple ( const ptr_tuple< Types > &  tpl)
inline

The copy constructor of the pointer tuple.

Parameters
tplthe source tuple

◆ ptr_tuple() [2/3]

template<class ... Types>
ext::ptr_tuple< Types >::ptr_tuple ( ptr_tuple< Types > &&  tpl)
inline

The move constructor of the pointer tuple.

Parameters
tplthe source tuple

◆ ptr_tuple() [3/3]

template<class ... Types>
template<class ... UTypes>
ext::ptr_tuple< Types >::ptr_tuple ( UTypes &&...  elems)
inlineexplicit

Tuple constructor from pack of source values.

Template Parameters
UTypes... pack of types of source values
Parameters
elems... pack of source values

◆ ~ptr_tuple()

template<class ... Types>
ext::ptr_tuple< Types >::~ptr_tuple ( )
inline

The pointer tuple destructor.

Member Function Documentation

◆ get() [1/3]

template<class ... Types>
template<std::size_t I>
auto & ext::ptr_tuple< Types >::get ( ) &
inline

Access method to inside the pointer tuple.

Template Parameters
Ithe index to retrieve
Returns
reference to the value at index I

◆ get() [2/3]

template<class ... Types>
template<std::size_t I>
auto && ext::ptr_tuple< Types >::get ( ) &&
inline

Access method to inside the pointer tuple.

Template Parameters
Ithe index to retrieve
Returns
reference to the value at index I

◆ get() [3/3]

template<class ... Types>
template<std::size_t I>
const auto & ext::ptr_tuple< Types >::get ( ) const &
inline

Access method to inside the pointer tuple.

Template Parameters
Ithe index to retrieve
Returns
reference to the value at index I

◆ operator<=>()

template<class ... Types>
auto ext::ptr_tuple< Types >::operator<=> ( const ext::ptr_tuple< Types ... > &  second) const
inline

Specialisation of the compare structure implementing the three-way comparison.

◆ operator=() [1/2]

template<class ... Types>
ptr_tuple< Types ... > & ext::ptr_tuple< Types >::operator= ( const ptr_tuple< Types ... > &  other)
inline

The pointer tuple copy operator of assignemnt.

Parameters
otherthe source value

◆ operator=() [2/2]

template<class ... Types>
ptr_tuple< Types ... > & ext::ptr_tuple< Types >::operator= ( ptr_tuple< Types ... > &&  other)
inline

The pointer tuple move operator of assignemnt.

Parameters
otherthe source value
Here is the call graph for this function:

◆ operator==()

template<class ... Types>
bool ext::ptr_tuple< Types >::operator== ( const ext::ptr_tuple< Types ... > &  second) const
inline

Specialisation of the compare structure implementing the three-way comparison.

◆ set()

template<class ... Types>
template<class R , std::size_t I>
void ext::ptr_tuple< Types >::set ( R &&  value)
inline

Setter method of a value inside the pointer tuple.

Template Parameters
Rthe actual type of value to store
Ithe index to retrieve
Here is the call graph for this function:

◆ swap()

template<class ... Types>
void ext::ptr_tuple< Types >::swap ( ptr_tuple< Types > &  other)
inline

Swaps two instances of pointer tuple.

Parameters
xthe other instance to swap with
Here is the call graph for this function:
Here is the caller graph for this function:

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