Table.hpp
70 auto floats() -> Deque<double>&; // TODO: These methods in Table that return Deque<T>& are dangerous in which the user can change its length, and this will not be reflected in mrows. Replace this by std::span when migrating to C++20.
110 else if constexpr(isInteger<T>) // keep integer check after booleans, as isInteger<bool> is true!
158 else if constexpr(isInteger<T>) // keep integer check after booleans, as isInteger<bool> is true!
162 else errorif(true, "You cannot cast this table column to a list of values with an unsupported type.");
auto booleans() const -> Deque< bool > const &
Convert this TableColumn object to a constant reference to its underlying Deque<bool> object.
auto integers() const -> Deque< long > const &
Convert this TableColumn object to a constant reference to its underlying Deque<long> object.
auto operator<<(Chars value) -> TableColumn &
Append a new string value to the TableColumn object.
Definition: Table.hpp:137
auto append(T const &value) -> void
Append a new value to the TableColumn object.
Definition: Table.hpp:106
auto operator<<(T const &value) -> TableColumn &
Append a new value to the TableColumn object.
Definition: Table.hpp:130
auto strings() const -> Deque< String > const &
Convert this TableColumn object to a constant reference to its underlying Deque<String> object.
auto appendBoolean(bool value) -> void
Append a new boolean value to the TableColumn object.
auto appendFloat(double value) -> void
Append a new floating-point value to the TableColumn object.
auto append(Chars value) -> void
Append a new string value to the TableColumn object.
Definition: Table.hpp:122
auto floats() const -> Deque< double > const &
Convert this TableColumn object to a constant reference to its underlying Deque<double> object.
auto cast() -> Deque< T > &
Cast this TableColumn object to a mutable reference to a list of values with type compatible with giv...
Definition: Table.hpp:145
auto appendString(String const &value) -> void
Append a new string value to the TableColumn object.
auto cast() const -> Deque< T > const &
Cast this TableColumn object to a constant reference to a list of values with type compatible with gi...
Definition: Table.hpp:152
DataType
Used in the identification of the value type along each column in the table.
Definition: Table.hpp:34
@ Float
The column data type indicating a double floating-point value value.
@ Undefined
The column data type has not been specified yet.
auto appendInteger(long value) -> void
Append a new integer value to the TableColumn object.
auto rows() const -> Index
Get the number of rows in the table (i.e., the length of the longest column in the table).
auto columns() const -> Dict< String, TableColumn > const &
Get the columns in the Table object.
auto dump(OutputOptions const &outputopts={}) const -> String
Assemble a string representation of the Table object.
auto save(String const &filepath, OutputOptions const &outputopts={}) const -> void
Save the Table object to a file.
auto column(String const &columnname) const -> TableColumn const &
Get a constant reference to a column in the table with given name.
#define errorif(condition,...)
Define a macro to raise a runtime exception if condition is true.
Definition: Exception.hpp:140
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
Used to specify formatting options when printing or outputting the Table object.
Definition: Table.hpp:206
String delimiter
The symbol used to separate column values on a table row (defaults to " | ").
Definition: Table.hpp:211
OutputOptions()
Construct a default OutputOptions object.
int precision
The precision used when printing floating-point values (defaults to 6).
Definition: Table.hpp:214
bool fixed
The boolean flag indicating if floating-point values should be printed in fixed notation (defaults to...
Definition: Table.hpp:220
bool scientific
The boolean flag indicating if floating-point values should be printed in scientific notation (defaul...
Definition: Table.hpp:217