te::qt::widgets::Promoter Class Reference

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

Detailed Description

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.

Note
When enabled, promotion consumes additional memory, because each primary key is stored.

Definition at line 69 of file Promoter.h.

Constructor & Destructor Documentation

te::qt::widgets::Promoter::Promoter ( )

Constructor.

te::qt::widgets::Promoter::~Promoter ( )

Destructor.

Member Function Documentation

void te::qt::widgets::Promoter::cleanLogRowsAndProcessKeys ( )

Cleans pre processed keys and vector of mapping logical rows.

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.

size_t te::qt::widgets::Promoter::getLogicalRow ( const size_t &  visualRow)

Returns the logical position of the row visualRow.

Parameters
visualRowThe visible row.
size_t te::qt::widgets::Promoter::map2Row ( te::da::ObjectId oid)

Given an object id returns its row.

Parameters
oidIdentifier of some row.
Returns
Position of the row identified by oid.
void te::qt::widgets::Promoter::preProcessKeys ( te::da::DataSet dset,
const std::vector< size_t > &  pkeys 
)

Proccess primary keys and stores it.

Parameters
dsetDataset to be used.
pkeysPositions of the primary keys columns.
Note
This operation DOES NOT take the ownership of dset.
void te::qt::widgets::Promoter::promote ( const te::da::ObjectIdSet oids)

Promotes the rows identified by oids primary keys.

Parameters
oidsSet of object ids to be promoted.
void te::qt::widgets::Promoter::resetPromotion ( )

Returns the rows to its original positions.

Member Data Documentation

std::vector<size_t> te::qt::widgets::Promoter::m_logicalRows
protected

Map original row to logical postion.

Definition at line 136 of file Promoter.h.

std::map<std::string, size_t> te::qt::widgets::Promoter::m_PkeysRows
protected

Map object id to its position in DataSet.

Definition at line 134 of file Promoter.h.


The documentation for this class was generated from the following file: