Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::Table Class Reference
+ Collaboration diagram for Feel::Table:

Public Types

enum class  MemoryLayout { RowMajor =0 , ColMajor }
 
using variant_value_type = std::variant< std::string, int, size_t, double, Feel::Table, Printer::OutputText, std::vector< Printer::OutputText > >
 

Public Member Functions

void add_col (std::initializer_list< variant_value_type > &&colValues)
 add column in table ( size of \colValues should be equal to M_nRow if table is non empty)
 
template<typename T , std::enable_if_t< is_iterable_v< T >, bool > = true>
void add_col (T &&colValues)
 add column in table ( size of \colValues should be equal to M_nRow if table is non empty)
 
void add_row (std::initializer_list< variant_value_type > &&rowValues)
 add row in table ( size of \rowValues should be equal to M_nCol if table is non empty)
 
template<typename T , std::enable_if_t< is_iterable_v< T >, bool > = true>
void add_row (T &&rowValues)
 add row in table ( size of \rowValues should be equal to M_nCol if table is non empty)
 
bool empty () const
 return true if the table is empty (i.e. nRow*nCol==0)
 
void exportAsciiDoc (std::ostream &o) const
 export into stream \o the asciidoc representation of the table
 
void exportAsciiDocImpl (std::ostream &o, std::string const &tableSeparator="|", int nestedTableLevel=0) const
 
void exportCSV (std::ostream &o) const
 export into stream \o the csv representation of the table (not work with nested table)
 
TableImpl::Format & format ()
 get table format
 
TableImpl::Format const & format () const
 get table format
 
int nCol () const
 number of column in table
 
int nRow () const
 number of row in table
 
TableImpl::Cell & operator() (int i, int j)
 get cell at indices i,j in table
 
TableImpl::Cell const & operator() (int i, int j) const
 get cell at indices i,j in table
 
Table & operator= (Table &&)=default
 
Table & operator= (Table const &)=default
 
void resize (int nRow, int nCol)
 resize the table
 
void set_col (int j, std::initializer_list< variant_value_type > &&colValues, int start_i=0)
 set column at index \i in table from initializer_list \colValues from row index i (j should be less than M_nCol, size of colValues should be <= M_nRow-i )
 
template<typename T , std::enable_if_t< is_iterable_v< T >, bool > = true>
void set_col (int j, T &&colValues, int start_i=0)
 set column at index \i in table from an iterable data \colValues from row index i (j should be less than M_nCol, size of colValues should be <= M_nRow-i )
 
void set_row (int i, std::initializer_list< variant_value_type > &&rowValues, int start_j=0)
 set row at index \i in table from initializer_list \rowValues from row index j (i should be less than M_nRow, size of rowValues should be <= M_nCol-j )
 
template<typename T , std::enable_if_t< is_iterable_v< T >, bool > = true>
void set_row (int i, T &&rowValues, int start_j=0)
 set row at index \i in table from an iterable data \rowValues from col index j (i should be less than M_nRow, size of rowValues should be <= M_nCol-j )
 
 Table (int nRow=0, int nCol=0, Table::MemoryLayout ml=Table::MemoryLayout::RowMajor)
 
 Table (Table &&)=default
 
 Table (Table const &t)
 
std::vector< Printer::OutputText > toOutputText () const
 return the output text of the table representation (each element of the vector start at a new line)
 
std::vector< Printer::OutputText > toOutputText (TableImpl::Format const &format) const
 return the output text of the table representation (each element of the vector start at a new line) the \format arg override the format of the table