Stimfit
0.13.15
|
A table used for printing information. More...
#include <stf.h>
Public Member Functions | |
Table (std::size_t nRows, std::size_t nCols) | |
Constructor. | |
Table (const std::map< std::string, double > &map) | |
Constructor. | |
double | at (std::size_t row, std::size_t col) const |
Range-checked access. Returns a copy. Throws std::out_of_range if out of range. | |
double & | at (std::size_t row, std::size_t col) |
Range-checked access. Returns a reference. Throws std::out_of_range if out of range. | |
bool | IsEmpty (std::size_t row, std::size_t col) const |
Check whether a cell is empty. | |
void | SetEmpty (std::size_t row, std::size_t col, bool value=true) |
Empties or un-empties a cell. | |
void | SetRowLabel (std::size_t row, const std::string &label) |
Sets the label of a row. | |
void | SetColLabel (std::size_t col, const std::string &label) |
Sets the label of a column. | |
const std::string & | GetRowLabel (std::size_t row) const |
Retrieves the label of a row. | |
const std::string & | GetColLabel (std::size_t col) const |
Retrieves the label of a column. | |
std::size_t | nRows () const |
Retrieves the number of rows. | |
std::size_t | nCols () const |
Retrieves the number of columns. | |
void | AppendRows (std::size_t nRows) |
Appends rows to the table. |
A table used for printing information.
Members will throw std::out_of_range if out of range.
stf::Table::Table | ( | std::size_t | nRows, |
std::size_t | nCols | ||
) |
Constructor.
nRows | Initial number of rows. |
nCols | Initial number of columns. |
stf::Table::Table | ( | const std::map< std::string, double > & | map | ) |
Constructor.
map | A map used to initialise the table. |
void stf::Table::AppendRows | ( | std::size_t | nRows | ) |
Appends rows to the table.
nRows | The number of rows to be appended. |
double stf::Table::at | ( | std::size_t | row, |
std::size_t | col | ||
) | const |
Range-checked access. Returns a copy. Throws std::out_of_range if out of range.
row | 0-based row index. |
col | 0-based column index. |
double& stf::Table::at | ( | std::size_t | row, |
std::size_t | col | ||
) |
Range-checked access. Returns a reference. Throws std::out_of_range if out of range.
row | 0-based row index. |
col | 0-based column index. |
const std::string& stf::Table::GetColLabel | ( | std::size_t | col | ) | const |
Retrieves the label of a column.
col | 0-based column index. |
const std::string& stf::Table::GetRowLabel | ( | std::size_t | row | ) | const |
Retrieves the label of a row.
row | 0-based row index. |
bool stf::Table::IsEmpty | ( | std::size_t | row, |
std::size_t | col | ||
) | const |
Check whether a cell is empty.
row | 0-based row index. |
col | 0-based column index. |
std::size_t stf::Table::nCols | ( | ) | const [inline] |
Retrieves the number of columns.
Definition at line 190 of file stf.h.
Referenced by wxStfTable::GetNumberCols().
std::size_t stf::Table::nRows | ( | ) | const [inline] |
Retrieves the number of rows.
Definition at line 185 of file stf.h.
Referenced by wxStfTable::GetNumberRows().
void stf::Table::SetColLabel | ( | std::size_t | col, |
const std::string & | label | ||
) |
Sets the label of a column.
col | 0-based column index. |
label | Column label string. |
void stf::Table::SetEmpty | ( | std::size_t | row, |
std::size_t | col, | ||
bool | value = true |
||
) |
Empties or un-empties a cell.
row | 0-based row index. |
col | 0-based column index. |
value | true if the cell should be empty, false otherwise. |
void stf::Table::SetRowLabel | ( | std::size_t | row, |
const std::string & | label | ||
) |
Sets the label of a row.
row | 0-based row index. |
label | Row label string. |