8#include <unordered_map>
19 using IteratorType = std::vector<std::unique_ptr<DataTableColumn>>::const_iterator;
69 std::unique_ptr<
std::mutex> sync_mtx_{std::make_unique<std::mutex>()};
70 std::vector<std::string> names_{};
71 std::unordered_map<std::string, std::size_t> index_{};
72 std::vector<std::unique_ptr<DataTableColumn>> columns_{};
73 size_t rows_count_ = 0;
DataTable columns interface data type.
Definition column.h:11
Defines a Datatable for in memory data class.
Definition datatable.h:16
IteratorType cbegin() const noexcept
Gets the iterator to the first column of the table.
Definition datatable.h:58
IteratorType cend() const noexcept
Gets the iterator element following the last column of the table.
Definition datatable.h:62
std::size_t num_columns() const noexcept
Gets the number of columns.
Definition datatable.cpp:10
std::size_t num_rows() const noexcept
Gets the number of rows.
Definition datatable.cpp:12
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.
Definition datatable.cpp:51
std::vector< std::string > names() const
Gets the collection of columns name.
Definition datatable.cpp:14
std::string to_string() const noexcept
Creates a string representation of the DataTable structure.
Definition datatable.cpp:59
void add(std::unique_ptr< DataTableColumn > column)
Adds a new column to the table.
Definition datatable.cpp:16
std::vector< std::unique_ptr< DataTableColumn > >::const_iterator IteratorType
DataTable columns iterator type.
Definition datatable.h:19
const DataTableColumn & column(std::size_t index) const
Gets the column at a given index.
Definition datatable.cpp:38
std::ostream & operator<<(std::ostream &stream, const hgps::core::DataTable &table)
Output streams operator for DataTable type.
Definition datatable.cpp:85
Top-level namespace for Health-GPS Core C++ API.
Definition analysis.h:7
Global namespace.
Definition column_iterator.h:123