rdbModel::Query Class Reference

#include <Query.h>

List of all members.

Public Member Functions

 Query (Table *table, const std::vector< std::string > *toSelect=0, Assertion *pAssert=0)
 ~Query ()
const std::vector< std::string > & getToSelect () const
const AssertiongetAssertion () const
const TablegetTable () const
void addSelect (const std::string &col)
Visitor::VisitorState accept (Visitor *v)

Private Attributes

Tablem_myTable
std::vector< std::stringm_toSelect
Assertionm_assert


Detailed Description

A query consists of a list of columns to be selected from rows in the table satisfying an assertion. For now, all elements in the assertion must refer to the same table.

Definition at line 18 of file Query.h.


Constructor & Destructor Documentation

rdbModel::Query::Query ( Table table,
const std::vector< std::string > *  toSelect = 0,
Assertion pAssert = 0 
)

Definition at line 8 of file Query.cxx.

References genRecEmupikp::i, and m_toSelect.

00009                                    : m_myTable(table), m_assert(pAssert) {
00010     m_toSelect.clear();
00011 
00012     if (toSelect != 0) {
00013       unsigned n = toSelect->size();
00014       m_toSelect.reserve(n);
00015       for (unsigned i = 0; i < n; i++) {
00016         m_toSelect.push_back((*toSelect)[i]);
00017       }
00018     }
00019     
00020   }

rdbModel::Query::~Query (  ) 

Definition at line 22 of file Query.cxx.

References m_toSelect.

00022                 {
00023     m_toSelect.clear();
00024     //    delete pAssert;   // ??   This is probably already done by ~Table
00025   }


Member Function Documentation

Visitor::VisitorState rdbModel::Query::accept ( Visitor v  ) 

Definition at line 27 of file Query.cxx.

References v, rdbModel::Visitor::VBRANCHDONE, and rdbModel::Visitor::VCONTINUE.

00027                                               {
00028     Visitor::VisitorState state = v->visitQuery(this);
00029     if (state == Visitor::VBRANCHDONE) return Visitor::VCONTINUE;
00030     return state;
00031   }

void rdbModel::Query::addSelect ( const std::string col  )  [inline]

Definition at line 27 of file Query.h.

References m_toSelect.

00027                                          {
00028       m_toSelect.push_back(col);
00029     }

const Assertion* rdbModel::Query::getAssertion (  )  const [inline]

Definition at line 25 of file Query.h.

References m_assert.

00025 {return m_assert;}

const Table* rdbModel::Query::getTable (  )  const [inline]

Definition at line 26 of file Query.h.

References m_myTable.

00026 {return m_myTable;}

const std::vector<std::string>& rdbModel::Query::getToSelect (  )  const [inline]

Definition at line 24 of file Query.h.

References m_toSelect.

00024 {return m_toSelect;}


Member Data Documentation

Assertion* rdbModel::Query::m_assert [private]

Definition at line 38 of file Query.h.

Referenced by getAssertion().

Table* rdbModel::Query::m_myTable [private]

Definition at line 35 of file Query.h.

Referenced by getTable().

std::vector<std::string> rdbModel::Query::m_toSelect [private]

Definition at line 37 of file Query.h.

Referenced by addSelect(), getToSelect(), Query(), and ~Query().


Generated on Tue Nov 29 23:36:36 2016 for BOSS_7.0.2 by  doxygen 1.4.7