Defines a Datatable for in memory data class.
More...
#include <datatable.h>
|
| std::size_t | num_columns () const noexcept |
| | Gets the number of columns.
|
| |
| std::size_t | num_rows () const noexcept |
| | Gets the number of rows.
|
| |
| std::vector< std::string > | names () const |
| | Gets the collection of columns name.
|
| |
| void | add (std::unique_ptr< DataTableColumn > column) |
| | Adds a new column to the table.
|
| |
| const DataTableColumn & | column (std::size_t index) const |
| | Gets the column at a given index.
|
| |
| const DataTableColumn & | column (const std::string &name) const |
| | Gets the column by name.
|
| |
| std::optional< std::reference_wrapper< const DataTableColumn > > | column_if_exists (const std::string &name) const |
| | Gets the column by name, also checking if the column exists.
|
| |
| IteratorType | cbegin () const noexcept |
| | Gets the iterator to the first column of the table.
|
| |
| IteratorType | cend () const noexcept |
| | Gets the iterator element following the last column of the table.
|
| |
| std::string | to_string () const noexcept |
| | Creates a string representation of the DataTable structure.
|
| |
Defines a Datatable for in memory data class.
◆ IteratorType
◆ add()
| void hgps::core::DataTable::add |
( |
std::unique_ptr< DataTableColumn > |
column | ) |
|
Adds a new column to the table.
- Parameters
-
- Exceptions
-
| std::invalid_argument | for duplicated column name or size mismatch. |
◆ cbegin()
Gets the iterator to the first column of the table.
- Returns
- An iterator to the beginning
◆ cend()
Gets the iterator element following the last column of the table.
- Returns
- An iterator to the end
◆ column() [1/2]
| const DataTableColumn & hgps::core::DataTable::column |
( |
const std::string & |
name | ) |
const |
Gets the column by name.
- Parameters
-
- Returns
- The column instance
- Exceptions
-
| std::out_of_range | for column name not found. |
◆ column() [2/2]
| const DataTableColumn & hgps::core::DataTable::column |
( |
std::size_t |
index | ) |
const |
Gets the column at a given index.
- Parameters
-
- Returns
- The column instance
- Exceptions
-
| std::out_of_range | for column index outside the range. |
◆ column_if_exists()
| std::optional< std::reference_wrapper< const DataTableColumn > > hgps::core::DataTable::column_if_exists |
( |
const std::string & |
name | ) |
const |
Gets the column by name, also checking if the column exists.
- Parameters
-
- Returns
- A pair containing a success flag, and the column instance on success.
◆ names()
| std::vector< std::string > hgps::core::DataTable::names |
( |
| ) |
const |
Gets the collection of columns name.
- Returns
- Columns name collection
◆ num_columns()
| std::size_t hgps::core::DataTable::num_columns |
( |
| ) |
const |
|
noexcept |
Gets the number of columns.
- Returns
- Number of columns
◆ num_rows()
| std::size_t hgps::core::DataTable::num_rows |
( |
| ) |
const |
|
noexcept |
Gets the number of rows.
- Returns
- Number of rows
◆ to_string()
| std::string hgps::core::DataTable::to_string |
( |
| ) |
const |
|
noexcept |
Creates a string representation of the DataTable structure.
- Returns
- The structure string representation
The documentation for this class was generated from the following files: