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.
te::qt::widgets::Promoter::Promoter | ( | ) |
Constructor.
Definition at line 133 of file Promoter.cpp.
te::qt::widgets::Promoter::~Promoter | ( | ) |
Destructor.
Definition at line 137 of file Promoter.cpp.
void te::qt::widgets::Promoter::cleanLogRowsAndProcessKeys | ( | ) |
Cleans pre processed keys and vector of mapping logical rows.
Definition at line 148 of file Promoter.cpp.
References ClearVector().
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 189 of file Promoter.cpp.
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 184 of file Promoter.cpp.
Referenced by GetExtent().
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 223 of file Promoter.cpp.
References GetRowPosition(), te::da::ObjectId::getValue(), and TE_TR.
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 155 of file Promoter.cpp.
References te::da::DataSet::getAsString(), te::da::DataSet::isNull(), te::da::DataSet::moveFirst(), te::da::DataSet::moveNext(), and te::da::DataSet::size().
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 194 of file Promoter.cpp.
References te::da::ObjectIdSet::begin(), and te::da::ObjectIdSet::end().
void te::qt::widgets::Promoter::resetPromotion | ( | ) |
Returns the rows to its original positions.
Definition at line 142 of file Promoter.cpp.
|
protected |
Map original row to logical postion.
Definition at line 136 of file Promoter.h.
|
protected |
Map object id to its position in DataSet.
Definition at line 134 of file Promoter.h.