Stimfit  0.13.15
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions
stf::Table Class Reference

A table used for printing information. More...

#include <stf.h>

List of all members.

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.

Detailed Description

A table used for printing information.

Members will throw std::out_of_range if out of range.

Definition at line 117 of file stf.h.


Constructor & Destructor Documentation

stf::Table::Table ( std::size_t  nRows,
std::size_t  nCols 
)

Constructor.

Parameters:
nRowsInitial number of rows.
nColsInitial number of columns.
stf::Table::Table ( const std::map< std::string, double > &  map)

Constructor.

Parameters:
mapA map used to initialise the table.

Member Function Documentation

void stf::Table::AppendRows ( std::size_t  nRows)

Appends rows to the table.

Parameters:
nRowsThe 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.

Parameters:
row0-based row index.
col0-based column index.
Returns:
A copy of the double at row, col.
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.

Parameters:
row0-based row index.
col0-based column index.
Returns:
A reference to the double at row, col.
const std::string& stf::Table::GetColLabel ( std::size_t  col) const

Retrieves the label of a column.

Parameters:
col0-based column index.
Returns:
Column label string.
const std::string& stf::Table::GetRowLabel ( std::size_t  row) const

Retrieves the label of a row.

Parameters:
row0-based row index.
Returns:
Row label string.
bool stf::Table::IsEmpty ( std::size_t  row,
std::size_t  col 
) const

Check whether a cell is empty.

Parameters:
row0-based row index.
col0-based column index.
Returns:
true if empty, false otherwise.
std::size_t stf::Table::nCols ( ) const [inline]

Retrieves the number of columns.

Returns:
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.

Returns:
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.

Parameters:
col0-based column index.
labelColumn label string.
void stf::Table::SetEmpty ( std::size_t  row,
std::size_t  col,
bool  value = true 
)

Empties or un-empties a cell.

Parameters:
row0-based row index.
col0-based column index.
valuetrue 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.

Parameters:
row0-based row index.
labelRow label string.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines