All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

Definition at line 133 of file Promoter.cpp.

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

Destructor.

Definition at line 137 of file Promoter.cpp.

Member Function Documentation

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.

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

Parameters
oidIdentifier of some row.
Returns
Position of the row identified by oid.

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.

Parameters
dsetDataset to be used.
pkeysPositions of the primary keys columns.
Note
This operation DOES NOT take the ownership of dset.

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.

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

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 files: