A class used for logical ordering of rows. More...
#include <Promoter.h>
Public Member Functions | |
| void | cleanLogRowsAndProcessKeys () |
| void | cleanPreproccessKeys () |
| Cleans the storage of the primary keys. Next time enabled, will be necessary to proccess all primary keys again. More... | |
| size_t | getLogicalRow (const size_t &visualRow) |
| Returns the logical position of the row visualRow. More... | |
| size_t | map2Row (te::da::ObjectId *oid) |
| Given an object id returns its row. More... | |
| void | preProcessKeys (te::da::DataSet *dset, const std::vector< size_t > &pkeys) |
| Proccess primary keys and stores it. More... | |
| void | promote (const te::da::ObjectIdSet *oids) |
| Promotes the rows identified by oids primary keys. More... | |
| Promoter () | |
| Constructor. More... | |
| void | resetPromotion () |
| Returns the rows to its original positions. More... | |
| ~Promoter () | |
| Destructor. More... | |
Protected Attributes | |
| std::vector< size_t > | m_logicalRows |
| Map original row to logical postion. More... | |
| std::map< std::string, size_t > | m_PkeysRows |
| Map object id to its position in DataSet. More... | |
A class used for logical ordering of rows.
The promotion just group a set of ObjectIds on the begining of table. When enable promotion requires some time to preproccess the primary keys of each data on the DataSet. Next time promotion is instantaneous.
Definition at line 69 of file Promoter.h.
|
default |
Constructor.
Referenced by GetRowPosition().
| te::qt::widgets::Promoter::~Promoter | ( | ) |
| void te::qt::widgets::Promoter::cleanLogRowsAndProcessKeys | ( | ) |
Cleans pre processed keys and vector of mapping logical rows.
Definition at line 146 of file Promoter.cpp.
References cleanPreproccessKeys(), ClearVector(), and m_logicalRows.
| void te::qt::widgets::Promoter::cleanPreproccessKeys | ( | ) |
Cleans the storage of the primary keys. Next time enabled, will be necessary to proccess all primary keys again.
Definition at line 190 of file Promoter.cpp.
References m_PkeysRows.
Referenced by cleanLogRowsAndProcessKeys(), preProcessKeys(), and ~Promoter().
| size_t te::qt::widgets::Promoter::getLogicalRow | ( | const size_t & | visualRow | ) |
Returns the logical position of the row visualRow.
| visualRow | The visible row. |
Definition at line 185 of file Promoter.cpp.
References m_logicalRows.
Referenced by te::qt::widgets::DataSetTableModel::data(), GetExtent(), te::qt::widgets::DataSetTableModel::getObjectIdSet(), te::qt::widgets::HighlightDelegate::paint(), and te::qt::widgets::DataSetTableModel::setData().
| size_t te::qt::widgets::Promoter::map2Row | ( | te::da::ObjectId * | oid | ) |
Given an object id returns its row.
| oid | Identifier of some row. |
Definition at line 224 of file Promoter.cpp.
References GetRowPosition(), te::da::ObjectId::getValue(), m_logicalRows, m_PkeysRows, and TE_TR.
Referenced by te::qt::widgets::DataSetTableView::highlightOIds(), and promote().
| void te::qt::widgets::Promoter::preProcessKeys | ( | te::da::DataSet * | dset, |
| const std::vector< size_t > & | pkeys | ||
| ) |
Proccess primary keys and stores it.
| dset | Dataset to be used. |
| pkeys | Positions of the primary keys columns. |
Definition at line 153 of file Promoter.cpp.
References cleanPreproccessKeys(), te::da::DataSet::getAsString(), te::da::DataSet::isNull(), m_logicalRows, m_PkeysRows, te::da::DataSet::moveFirst(), te::da::DataSet::moveNext(), and te::da::DataSet::size().
Referenced by te::qt::widgets::DataSetTableView::setAutoScrollEnabled(), te::qt::widgets::DataSetTableView::setPromotionEnabled(), and te::qt::widgets::DataSetTableView::sortByColumns().
| void te::qt::widgets::Promoter::promote | ( | const te::da::ObjectIdSet * | oids | ) |
Promotes the rows identified by oids primary keys.
| oids | Set of object ids to be promoted. |
Definition at line 195 of file Promoter.cpp.
References te::da::ObjectIdSet::begin(), te::da::ObjectIdSet::end(), m_logicalRows, m_PkeysRows, map2Row(), and resetPromotion().
Referenced by te::qt::widgets::DataSetTableModel::promote().
| void te::qt::widgets::Promoter::resetPromotion | ( | ) |
Returns the rows to its original positions.
Definition at line 140 of file Promoter.cpp.
References m_logicalRows.
Referenced by promote().
|
protected |
Map original row to logical postion.
Definition at line 136 of file Promoter.h.
Referenced by cleanLogRowsAndProcessKeys(), getLogicalRow(), map2Row(), preProcessKeys(), promote(), and resetPromotion().
|
protected |
Map object id to its position in DataSet.
Definition at line 134 of file Promoter.h.
Referenced by cleanPreproccessKeys(), map2Row(), preProcessKeys(), and promote().