|
Health-GPS
1.2.2.0
Global Health Policy Simulation model (Health-GPS)
|
Defines a Datatable for in memory data class. More...
#include <datatable.h>
Public Types | |
| using | IteratorType = std::vector< std::unique_ptr< DataTableColumn > >::const_iterator |
| DataTable columns iterator type. More... | |
Public Member Functions | |
| std::size_t | num_columns () const noexcept |
| Gets the number of columns. More... | |
| std::size_t | num_rows () const noexcept |
| Gets the number of rows. More... | |
| std::vector< std::string > | names () const |
| Gets the collection of columns name. More... | |
| void | add (std::unique_ptr< DataTableColumn > column) |
| Adds a new column to the table. More... | |
| const DataTableColumn & | column (std::size_t index) const |
| Gets the column at a given index. More... | |
| const DataTableColumn & | column (const std::string &name) const |
| Gets the column by name. More... | |
| IteratorType | cbegin () const noexcept |
| Gets the iterator to the first column of the table. More... | |
| IteratorType | cend () const noexcept |
| Gets the iterator element following the last column of the table. More... | |
| std::string | to_string () const noexcept |
| Creates a string representation of the DataTable structure. More... | |
Defines a Datatable for in memory data class.
| using hgps::core::DataTable::IteratorType = std::vector<std::unique_ptr<DataTableColumn> >::const_iterator |
DataTable columns iterator type.
| void hgps::core::DataTable::add | ( | std::unique_ptr< DataTableColumn > | column | ) |
Adds a new column to the table.
| column | The column to add |
| std::invalid_argument | for duplicated column name or size mismatch. |
|
inlinenoexcept |
Gets the iterator to the first column of the table.
|
inlinenoexcept |
Gets the iterator element following the last column of the table.
| const DataTableColumn & hgps::core::DataTable::column | ( | const std::string & | name | ) | const |
Gets the column by name.
| name | The column name |
| std::out_of_range | for column name not found. |
| const DataTableColumn & hgps::core::DataTable::column | ( | std::size_t | index | ) | const |
Gets the column at a given index.
| index | Column index |
| std::out_of_range | for column index outside the range. |
| std::vector< std::string > hgps::core::DataTable::names | ( | ) | const |
Gets the collection of columns name.
|
noexcept |
Gets the number of columns.
|
noexcept |
Gets the number of rows.
|
noexcept |
Creates a string representation of the DataTable structure.