Euphoria
eu::core::TableGenerator< T > Struct Template Reference

#include <table_string.h>

Inheritance diagram for eu::core::TableGenerator< T >:
eu::core::SortBuilder< T, TableGenerator< T > >

Public Types

using ToStringFunction = std::function< std::string(const T &)>
 

Public Member Functions

 TableGenerator (const std::vector< T > &d)
 
TableGenerator< T > & add_column (const std::string &title, ToStringFunction to_string)
 
StringTable to_table () const
 
- Public Member Functions inherited from eu::core::SortBuilder< T, TableGenerator< T > >
TableGenerator< T > & sort (TValue T::*member, TSortFunc sort_func, SortStyle sort_style=SortStyle::ascending)
 
TableGenerator< T > & sort (TValue T::*member, SortStyle sort_style=SortStyle::ascending)
 
TableGenerator< T > & use_stable_sort ()
 

Public Attributes

const std::vector< T > & data
 
std::vector< ToStringFunctioncolumn_to_string
 
std::vector< std::string > column_titles
 
- Public Attributes inherited from eu::core::SortBuilder< T, TableGenerator< T > >
SortableList< T > sort_order
 
bool stable_sort
 

Detailed Description

template<typename T>
struct eu::core::TableGenerator< T >

Definition at line 19 of file table_string.h.

Member Typedef Documentation

◆ ToStringFunction

template<typename T >
using eu::core::TableGenerator< T >::ToStringFunction = std::function<std::string(const T&)>

Definition at line 21 of file table_string.h.

Constructor & Destructor Documentation

◆ TableGenerator()

template<typename T >
eu::core::TableGenerator< T >::TableGenerator ( const std::vector< T > &  d)
inlineexplicit

Definition at line 27 of file table_string.h.

Member Function Documentation

◆ add_column()

template<typename T >
TableGenerator<T>& eu::core::TableGenerator< T >::add_column ( const std::string &  title,
ToStringFunction  to_string 
)
inline

Definition at line 33 of file table_string.h.

◆ to_table()

template<typename T >
StringTable eu::core::TableGenerator< T >::to_table ( ) const
inline

Definition at line 41 of file table_string.h.

Member Data Documentation

◆ column_titles

template<typename T >
std::vector<std::string> eu::core::TableGenerator< T >::column_titles

Definition at line 25 of file table_string.h.

◆ column_to_string

template<typename T >
std::vector<ToStringFunction> eu::core::TableGenerator< T >::column_to_string

Definition at line 24 of file table_string.h.

◆ data

template<typename T >
const std::vector<T>& eu::core::TableGenerator< T >::data

Definition at line 23 of file table_string.h.


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