Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

LcgInfo::TableRowTranslator Class Reference

This class is used to map canonical GLUE table and row names to implementation specific table and row names. More...

#include <TableRowTranslator.h>

List of all members.

Public Methods

 TableRowTranslator ()
 Constructor using "./mappingGlueRGMA" as the default name for the mapfile. More...

 TableRowTranslator (std::string const &pMapFile)
 Constructor passing the name of the file that has to be used for the mapping. More...

 TableRowTranslator (LcgConfigBuffer::ConfigBuffer &pMap)
 Constructor passing a reference to the already existing LcgConfigBuffer::ConfigBuffer object that is used for the mapping. More...

 ~TableRowTranslator ()
 Destructor of the class. More...

std::string mapTableRow (std::string const &pTableRow)
 Maps a "table.pair" string from the canonical GLUE format to the implementation format. More...

bool thereIsStructChange ()
 Checks if the previously performed table.row translation involves the addition of new predicates showing the relations among tables for a correct execution of the query (this can occur for multi-valued attributes, inlined tables...). More...

std::vector< std::string
>::iterator 
getPredicatesBegin ()
 Returns an iterator for the first element of the vector of predicates that should be applied to the processed query, as a result of the last performed table.row translation. More...

std::vector< std::string
>::iterator 
getPredicatesEnd ()
 Returns an iterator for the first element of the vector of predicates that should be applied to the processed query, as a result of the last performed table.row translation. More...


Detailed Description

This class is used to map canonical GLUE table and row names to implementation specific table and row names.

For every translation it also indicates if a structural change has happened (a row has been changed to another place in the tables schema), and, thus, new predicates showing the table relations must be applied.

Author:
LCG's EIS Group. CERN.
Version:
1.0
Date:
2004.

Definition at line 29 of file TableRowTranslator.h.


Constructor & Destructor Documentation

TableRowTranslator::TableRowTranslator  
 

Constructor using "./mappingGlueRGMA" as the default name for the mapfile.

It may throw a QueryTranslationException if the specified mapping file cannot be loaded. Please do not use this constructor.

Definition at line 14 of file TableRowTranslator.cpp.

References LcgInfo::int2str, and LcgConfigBuffer::ConfigBuffer::populate_from_config.

TableRowTranslator::TableRowTranslator std::string const &    pMapFile
 

Constructor passing the name of the file that has to be used for the mapping.

It may throw a QueryTranslationException if the specified mapping file cannot be loaded.

Parameters:
pMapFile  The name of the mapping file

Definition at line 29 of file TableRowTranslator.cpp.

References LcgInfo::int2str, and LcgConfigBuffer::ConfigBuffer::populate_from_config.

TableRowTranslator::TableRowTranslator LcgConfigBuffer::ConfigBuffer   pMap
 

Constructor passing a reference to the already existing LcgConfigBuffer::ConfigBuffer object that is used for the mapping.

Using this constructor implies that the LcgConfigBuffer::ConfigBuffer object was instantiated externally, and it requires that it does not go out of scope.

Parameters:
pMap  A reference to the LcgConfigBuffer::ConfigBuffer object used for the mapping

Definition at line 42 of file TableRowTranslator.cpp.

TableRowTranslator::~TableRowTranslator  
 

Destructor of the class.

Destroys the LcgConfigBuffer::ConfigBuffer member.

Definition at line 47 of file TableRowTranslator.cpp.


Member Function Documentation

vector< string >::iterator TableRowTranslator::getPredicatesBegin  
 

Returns an iterator for the first element of the vector of predicates that should be applied to the processed query, as a result of the last performed table.row translation.

See also:
getPredicatesEnd , thereIsStructChange , mapTableRow
Returns:
an iterator pointing to the first element of the vector of predicates

Definition at line 106 of file TableRowTranslator.cpp.

vector< string >::iterator TableRowTranslator::getPredicatesEnd  
 

Returns an iterator for the first element of the vector of predicates that should be applied to the processed query, as a result of the last performed table.row translation.

See also:
getPredicatesBegin , thereIsStructChange , mapTableRow
Returns:
an iterator pointing to the first element of the vector of predicates

Definition at line 110 of file TableRowTranslator.cpp.

string TableRowTranslator::mapTableRow std::string const &    pTableRow
 

Maps a "table.pair" string from the canonical GLUE format to the implementation format.

In the canonical format, "table" correponds to the GLUE "namespace.object", where the object part can contain also a dot (for dependent objects), and "row" corresponds to the GLUE attribute. This method also modifies the value of the mPredicates variable, if the translation requires new predicates.a It may throw a LcgConfigBuffer::CBException, if the specified attribute cannot be matched for some reason.

See also:
thereIsStructChange , getStructChange
Parameters:
pTableRow  The original table.row name in canonical format
Returns:
The corresponding table.row in implementation-format

Definition at line 55 of file TableRowTranslator.cpp.

References LcgInfo::delSurroundingChars, LcgConfigBuffer::ConfigBuffer::get_attribute_value, and LcgInfo::tokenizeStr.

bool TableRowTranslator::thereIsStructChange  
 

Checks if the previously performed table.row translation involves the addition of new predicates showing the relations among tables for a correct execution of the query (this can occur for multi-valued attributes, inlined tables...).

See also:
getPredicatesBegin , getPredicatesEnd , mapTableRow
Returns:
true if an structural change happened and new predicates must be applied

Definition at line 101 of file TableRowTranslator.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 5 14:42:45 2004 for LCG Information System Interface by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002