Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
Represents a table. More...
#include <Table.h>
Public Types | |
typedef std::vector< Row >::const_iterator | const_iterator |
Public Member Functions | |
Table (std::vector< Row > row_list) | |
Constructs a Table with the given rows. | |
Table (std::shared_ptr< ColumnInfo > column_info) | |
Construct an empty Table with associated metadata. | |
virtual | ~Table ()=default |
Default destructor. | |
std::shared_ptr< ColumnInfo > | getColumnInfo () const |
Returns a ColumnInfo object describing the columns of the table. | |
std::size_t | size () const |
Returns the number of rows in the table. | |
const Row & | operator[] (std::size_t index) const |
Returns the row with the given index (zero based) | |
const_iterator | begin () const |
Returns a const iterator to the first row. | |
const_iterator | end () const |
Returns a const iterator to the past-the-end row. | |
Private Attributes | |
std::vector< Row > | m_row_list |
std::shared_ptr< ColumnInfo > | m_column_info |
Represents a table.
The Table is an immutable class which represents a table. It contains a list of Rows, which all have the same columns. Note that because the Table is immutable instances without rows are not allowed.
typedef std::vector<Row>::const_iterator Euclid::Table::Table::const_iterator |
|
explicit |
Constructs a Table with the given rows.
The given row_list, which cannot be empty, must contain Rows which have the same ColumnInfo. Rows with different columns are not allowed.
row_list | The rows of the table |
Elements::Exception | if the given list is empty |
Elements::Exception | if not all the rows have the same columns |
Definition at line 31 of file Table.cpp.
References m_column_info, and m_row_list.
|
explicit |
|
virtualdefault |
Default destructor.
Table::const_iterator Euclid::Table::Table::begin | ( | ) | const |
Returns a const iterator to the first row.
Definition at line 65 of file Table.cpp.
References m_row_list.
Table::const_iterator Euclid::Table::Table::end | ( | ) | const |
Returns a const iterator to the past-the-end row.
Definition at line 69 of file Table.cpp.
References m_row_list.
std::shared_ptr< ColumnInfo > Euclid::Table::Table::getColumnInfo | ( | ) | const |
Returns a ColumnInfo object describing the columns of the table.
Definition at line 50 of file Table.cpp.
References m_column_info.
Referenced by Pyston::table2numpy().
const Row & Euclid::Table::Table::operator[] | ( | std::size_t | index | ) | const |
Returns the row with the given index (zero based)
index | The index of the row (zero based) |
Elements::Exception | if the index is out of range |
Definition at line 58 of file Table.cpp.
References m_row_list.
std::size_t Euclid::Table::Table::size | ( | ) | const |
Returns the number of rows in the table.
Definition at line 54 of file Table.cpp.
References m_row_list.
Referenced by Pyston::table2numpy().
|
private |
Definition at line 123 of file Table.h.
Referenced by getColumnInfo(), and Table().
|
private |