NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This data container is a copy- efficient table to interchange data between Kernel and GUI. More...
#include <table.hpp>
Public Member Functions | |
Table () | |
Default constructor. More... | |
Table (int nLines, int nCols) | |
Size constructor. More... | |
Table (const Table &_table) | |
Copy constructor. More... | |
Table (Table &&_table) | |
Move constructor. More... | |
~Table () | |
Destructor. More... | |
Table & | operator= (Table _table) |
Move assignment operator. More... | |
void | Clear () |
This member function cleares the contents of this table. More... | |
void | setSize (size_t i, size_t j) |
This member function simply redirects the control to setMinSize(). More... | |
void | setName (const std::string &_sName) |
Setter function for the table name. More... | |
void | setComment (const std::string &_comment) |
Setter function for the table comment. More... | |
void | setMetaData (const TableMetaData &meta) |
Setter function for the table meta data. More... | |
void | setHead (size_t i, const std::string &_sHead) |
Setter function for the selected column headline. Will create missing headlines automatically. More... | |
void | setHeadPart (size_t i, size_t part, const std::string &_sHead) |
Setter function for the selected column headline and the selected part of the headline (split using linebreak characters). Will create the missing headlines automatically. More... | |
void | setValue (size_t i, size_t j, const mu::value_type &_dValue) |
This member function sets the data to the table. It will resize the table automatically, if needed. More... | |
void | setValueAsString (size_t i, size_t j, const std::string &_sValue) |
This member function sets the data, which is passed as a string, to the table. If the data is not a numerical value, the data is assigned to the corresponding column head. More... | |
void | setColumn (size_t j, TableColumn *column) |
Assigns a whole column to the internal array. More... | |
bool | setColumnType (size_t j, TableColumn::ColumnType _type) |
Tries to change the column type of the selected column. More... | |
std::string | getName () const |
Getter function for the table name. More... | |
std::string | getComment () const |
Getter function for the table comment. More... | |
TableMetaData | getMetaData () const |
Getter function for the table meta data. More... | |
int | getHeadCount () const |
Getter function for the needed number of headlines (depending on the number of linebreaks found in the headlines). More... | |
std::string | getHead (size_t i) const |
Getter function for the selected column's headline. More... | |
std::string | getCleanHead (size_t i) const |
Getter function for the selected column's headline. Underscores and masked headlines are replaced on-the-fly. More... | |
std::string | getCleanHeadPart (size_t i, size_t part=0) const |
Getter function for the selected part of the selected column's headline. Underscores and masked headlines are replaced on-the-fly. More... | |
mu::value_type | getValue (size_t i, size_t j) const |
Getter function for the value of the selected cell. More... | |
std::string | getValueAsString (size_t i, size_t j) const |
Getter function for the value of the selected cell. The value is converted into a string. More... | |
TableColumn * | getColumn (size_t j) const |
Returns a copy of the internal column array or a nullptr, if the column does not exist or is empty. More... | |
TableColumn::ColumnType | getColumnType (size_t j) const |
Returns the type of the selected column. More... | |
TableColumnArray & | getTableData () |
size_t | getLines () const |
Get the number of lines. More... | |
size_t | getCols () const |
Get the number of columns. More... | |
bool | isEmpty () const |
Return, whether the table is empty. More... | |
bool | insertLines (size_t nPos=0, size_t nNum=1) |
This member function inserts lines at the desired position. More... | |
bool | appendLines (size_t nNum=1) |
This member function appends lines. More... | |
bool | deleteLines (size_t nPos=0, size_t nNum=1) |
This member function deletes lines at the desired position. More... | |
bool | insertCols (size_t nPos=0, size_t nNum=1) |
This member function inserts columns at the desired position. More... | |
bool | appendCols (size_t nNum=1) |
This member function appends columns. More... | |
bool | deleteCols (size_t nPos=0, size_t nNum=1) |
This member function delets columns at the desired position. More... | |
Private Member Functions | |
void | setMinSize (size_t i, size_t j) |
This member function prepares a table with the minimal size of the selected lines and columns. More... | |
bool | isNumerical (const std::string &sValue) const |
This member function is a simple helper function to determine, whether a passed value may be parsed into a numerical value. More... | |
Private Attributes | |
TableColumnArray | vTableData |
std::string | sTableName |
TableMetaData | m_meta |
This data container is a copy- efficient table to interchange data between Kernel and GUI.
NumeRe::Table::Table | ( | ) |
NumeRe::Table::Table | ( | int | nLines, |
int | nCols | ||
) |
NumeRe::Table::Table | ( | const Table & | _table | ) |
Copy constructor.
_table | const Table& |
Definition at line 57 of file table.cpp.
References vTableData.
NumeRe::Table::Table | ( | Table && | _table | ) |
Move constructor.
_table | Table&& |
Definition at line 75 of file table.cpp.
References vTableData.
NumeRe::Table::~Table | ( | ) |
bool NumeRe::Table::appendCols | ( | size_t | nNum = 1 | ) |
This member function appends columns.
nNum | size_t |
Definition at line 763 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::AppendCols().
bool NumeRe::Table::appendLines | ( | size_t | nNum = 1 | ) |
This member function appends lines.
nNum | size_t |
Definition at line 704 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::AppendRows().
void NumeRe::Table::Clear | ( | ) |
This member function cleares the contents of this table.
Definition at line 149 of file table.cpp.
References sTableName, and vTableData.
Referenced by GridNumeReTable::Clear().
bool NumeRe::Table::deleteCols | ( | size_t | nPos = 0 , |
size_t | nNum = 1 |
||
) |
This member function delets columns at the desired position.
nPos | size_t |
nNum | size_t |
Definition at line 780 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::DeleteCols().
bool NumeRe::Table::deleteLines | ( | size_t | nPos = 0 , |
size_t | nNum = 1 |
||
) |
This member function deletes lines at the desired position.
nPos | size_t |
nNum | size_t |
Definition at line 725 of file table.cpp.
References getHeadCount(), and vTableData.
Referenced by GridNumeReTable::DeleteRows().
std::string NumeRe::Table::getCleanHead | ( | size_t | i | ) | const |
Getter function for the selected column's headline. Underscores and masked headlines are replaced on-the-fly.
i | size_t |
Definition at line 487 of file table.cpp.
References TableColumn::getDefaultColumnHead(), and vTableData.
Referenced by getCleanHeadPart().
std::string NumeRe::Table::getCleanHeadPart | ( | size_t | i, |
size_t | part = 0 |
||
) | const |
Getter function for the selected part of the selected column's headline. Underscores and masked headlines are replaced on-the-fly.
i | size_t |
part | size_t |
Definition at line 507 of file table.cpp.
References getCleanHead(), TableColumn::getDefaultColumnHead(), getHeadCount(), and vTableData.
Referenced by GridNumeReTable::GetValue(), and setHeadPart().
size_t NumeRe::Table::getCols | ( | ) | const |
Get the number of columns.
Definition at line 656 of file table.cpp.
References vTableData.
Referenced by fastWaveletTransform(), GridNumeReTable::getColumnTypes(), GridNumeReTable::GetNumberCols(), GridNumeReTable::GetValue(), GridNumeReTable::GetValueAsBool(), GridNumeReTable::GetValueAsDouble(), Memory::importTable(), and TableViewer::saveTable().
TableColumn * NumeRe::Table::getColumn | ( | size_t | j | ) | const |
Returns a copy of the internal column array or a nullptr, if the column does not exist or is empty.
j | size_t |
Definition at line 604 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::CanGetValueAs(), GridNumeReTable::getCategories(), and Memory::importTable().
TableColumn::ColumnType NumeRe::Table::getColumnType | ( | size_t | j | ) | const |
Returns the type of the selected column.
j | size_t |
Definition at line 621 of file table.cpp.
References TableColumn::TYPE_NONE, and vTableData.
Referenced by GridNumeReTable::CanGetValueAs(), GridNumeReTable::getCategories(), and GridNumeReTable::getColumnTypes().
std::string NumeRe::Table::getComment | ( | ) | const |
Getter function for the table comment.
Definition at line 415 of file table.cpp.
References NumeRe::TableMetaData::comment, and m_meta.
std::string NumeRe::Table::getHead | ( | size_t | i | ) | const |
Getter function for the selected column's headline.
i | size_t |
Definition at line 469 of file table.cpp.
References TableColumn::getDefaultColumnHead(), and vTableData.
int NumeRe::Table::getHeadCount | ( | ) | const |
Getter function for the needed number of headlines (depending on the number of linebreaks found in the headlines).
Definition at line 429 of file table.cpp.
References vTableData.
Referenced by deleteLines(), getCleanHeadPart(), GridNumeReTable::getNumHeadlines(), insertLines(), TableViewer::SetData(), and setHeadPart().
size_t NumeRe::Table::getLines | ( | ) | const |
Get the number of lines.
Definition at line 636 of file table.cpp.
References vTableData.
Referenced by fastWaveletTransform(), GridNumeReTable::GetNumberRows(), GridNumeReTable::GetValue(), GridNumeReTable::GetValueAsBool(), GridNumeReTable::GetValueAsDouble(), Memory::importTable(), TableViewer::saveTable(), and TableViewer::SetData().
TableMetaData NumeRe::Table::getMetaData | ( | ) | const |
Getter function for the table meta data.
Definition at line 403 of file table.cpp.
References m_meta.
Referenced by Memory::importTable(), TableViewer::saveTable(), and TableViewer::SetData().
std::string NumeRe::Table::getName | ( | ) | const |
Getter function for the table name.
Definition at line 390 of file table.cpp.
References sTableName.
|
inline |
Definition at line 130 of file table.hpp.
References vTableData.
Referenced by TableViewer::saveTable().
mu::value_type NumeRe::Table::getValue | ( | size_t | i, |
size_t | j | ||
) | const |
Getter function for the value of the selected cell.
i | size_t |
j | size_t |
Definition at line 561 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::avg(), GridNumeReTable::CanGetValueAs(), fastWaveletTransform(), GridNumeReTable::GetValueAsBool(), GridNumeReTable::GetValueAsCustom(), GridNumeReTable::GetValueAsDouble(), GridNumeReTable::max(), GridNumeReTable::min(), and GridNumeReTable::sum().
std::string NumeRe::Table::getValueAsString | ( | size_t | i, |
size_t | j | ||
) | const |
Getter function for the value of the selected cell. The value is converted into a string.
i | size_t |
j | size_t |
Definition at line 580 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::GetValue().
bool NumeRe::Table::insertCols | ( | size_t | nPos = 0 , |
size_t | nNum = 1 |
||
) |
This member function inserts columns at the desired position.
nPos | size_t |
nNum | size_t |
Definition at line 748 of file table.cpp.
References vTableData.
Referenced by GridNumeReTable::InsertCols().
bool NumeRe::Table::insertLines | ( | size_t | nPos = 0 , |
size_t | nNum = 1 |
||
) |
This member function inserts lines at the desired position.
nPos | size_t |
nNum | size_t |
Definition at line 683 of file table.cpp.
References getHeadCount(), and vTableData.
Referenced by GridNumeReTable::InsertRows().
bool NumeRe::Table::isEmpty | ( | ) | const |
Return, whether the table is empty.
Definition at line 668 of file table.cpp.
References vTableData.
Referenced by editObject(), and TableViewer::SetData().
|
private |
This member function is a simple helper function to determine, whether a passed value may be parsed into a numerical value.
sValue | const std::string& |
Definition at line 136 of file table.cpp.
References CONVTYPE_VALUE, and isConvertible().
Move assignment operator.
_table | Table |
Definition at line 98 of file table.cpp.
References m_meta, sTableName, and vTableData.
void NumeRe::Table::setColumn | ( | size_t | j, |
TableColumn * | column | ||
) |
Assigns a whole column to the internal array.
j | size_t |
column | TableColumn* |
Definition at line 357 of file table.cpp.
References vTableData.
Referenced by Memory::extractTable().
bool NumeRe::Table::setColumnType | ( | size_t | j, |
TableColumn::ColumnType | _type | ||
) |
Tries to change the column type of the selected column.
j | size_t |
_type | TableColumn::ColumnType |
Definition at line 375 of file table.cpp.
References convert_if_needed(), and vTableData.
Referenced by TableViewer::changeColType().
void NumeRe::Table::setComment | ( | const std::string & | _comment | ) |
Setter function for the table comment.
_comment | const std::string& |
Definition at line 213 of file table.cpp.
References NumeRe::TableMetaData::comment, and m_meta.
Referenced by TableViewer::GetData(), and TableViewer::GetDataCopy().
void NumeRe::Table::setHead | ( | size_t | i, |
const std::string & | _sHead | ||
) |
Setter function for the selected column headline. Will create missing headlines automatically.
i | size_t |
_sHead | const std::string& |
Definition at line 229 of file table.cpp.
References vTableData.
void NumeRe::Table::setHeadPart | ( | size_t | i, |
size_t | part, | ||
const std::string & | _sHead | ||
) |
Setter function for the selected column headline and the selected part of the headline (split using linebreak characters). Will create the missing headlines automatically.
i | size_t |
part | size_t |
_sHead | const std::string& |
Definition at line 254 of file table.cpp.
References getCleanHeadPart(), getHeadCount(), and vTableData.
Referenced by GridNumeReTable::SetValue().
void NumeRe::Table::setMetaData | ( | const TableMetaData & | meta | ) |
Setter function for the table meta data.
meta | const TableMetaData& |
Definition at line 200 of file table.cpp.
References m_meta.
Referenced by Memory::extractTable().
|
private |
This member function prepares a table with the minimal size of the selected lines and columns.
i | size_t |
j | size_t |
Definition at line 119 of file table.cpp.
References vTableData.
Referenced by setSize(), setValue(), and setValueAsString().
void NumeRe::Table::setName | ( | const std::string & | _sName | ) |
Setter function for the table name.
_sName | const std::string& |
Definition at line 186 of file table.cpp.
References sTableName.
Referenced by Memory::extractTable().
void NumeRe::Table::setSize | ( | size_t | i, |
size_t | j | ||
) |
This member function simply redirects the control to setMinSize().
i | size_t |
j | size_t |
Definition at line 165 of file table.cpp.
References setMinSize(), and vTableData.
Referenced by decodeWaveletData(), and Table().
void NumeRe::Table::setValue | ( | size_t | i, |
size_t | j, | ||
const mu::value_type & | _dValue | ||
) |
This member function sets the data to the table. It will resize the table automatically, if needed.
i | size_t |
j | size_t |
_dValue | const mu::value_type& |
Definition at line 291 of file table.cpp.
References convert_if_empty(), setMinSize(), TableColumn::TYPE_VALUE, and vTableData.
Referenced by decodeWaveletData().
void NumeRe::Table::setValueAsString | ( | size_t | i, |
size_t | j, | ||
const std::string & | _sValue | ||
) |
This member function sets the data, which is passed as a string, to the table. If the data is not a numerical value, the data is assigned to the corresponding column head.
i | size_t |
j | size_t |
_sValue | const string& |
Definition at line 312 of file table.cpp.
References convert_if_needed(), CONVTYPE_DATE_TIME, CONVTYPE_LOGICAL, CONVTYPE_VALUE, isConvertible(), setMinSize(), StrToCmplx(), StrToLogical(), StrToTime(), to_double(), TableColumn::TYPE_DATETIME, TableColumn::TYPE_LOGICAL, TableColumn::TYPE_STRING, TableColumn::TYPE_VALUE, and vTableData.
Referenced by GridNumeReTable::SetValue().
|
private |
Definition at line 91 of file table.hpp.
Referenced by getComment(), getMetaData(), operator=(), setComment(), and setMetaData().
|
private |
|
private |
Definition at line 89 of file table.hpp.
Referenced by appendCols(), appendLines(), Clear(), deleteCols(), deleteLines(), getCleanHead(), getCleanHeadPart(), getCols(), getColumn(), getColumnType(), getHead(), getHeadCount(), getLines(), getTableData(), getValue(), getValueAsString(), insertCols(), insertLines(), isEmpty(), operator=(), setColumn(), setColumnType(), setHead(), setHeadPart(), setMinSize(), setSize(), setValue(), setValueAsString(), Table(), and ~Table().