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

LcgInfo::QueryTranslator Class Reference

This class (actually, extending ones, since this is not instantiable) is used to translate a query posed to a canonical relational schema into a new query that can be posed to an equivalent schema (i.e.: containing the same actual information), in order to retrieve the same information. More...

#include <QueryTranslator.h>

Inheritance diagram for LcgInfo::QueryTranslator:

LcgInfo::SQLQueryTranslator LcgInfo::SQLtoLDAPQueryTranslator LcgInfo::SQLtoSQLQueryTranslator List of all members.

Public Methods

 QueryTranslator ()
 Constructor using "./mappingGlueRMA" as the default name for the mapfile. More...

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

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

virtual ~QueryTranslator ()
 Destructor of the class.

virtual std::vector< std::string > translateQuery (std::string const &pQueryCanonical)=0
 Translates the specified query (intended to be posed to the canonical schema) into some new queries that can be posed to the implementation specific schema (in order) to retrieve the same information. More...


Protected Attributes

LcgConfigBuffer::ConfigBuffermMap
 A pointer to the object that reads the mapping file and holds the information there contained. More...

bool mOurMap
 A boolean to know if mMap was created by us, and thus our destructor must delete it (true), or it was created outside us, and we should not destroy it (false).

TableRowTranslatormTRowT
 A pointer to the object that can perform the translation between the canonical names and the implementation ones. More...


Detailed Description

This class (actually, extending ones, since this is not instantiable) is used to translate a query posed to a canonical relational schema into a new query that can be posed to an equivalent schema (i.e.: containing the same actual information), in order to retrieve the same information.

The equivalent schema is mapped to the canonical one using a mapping file (whose syntax must conform to the standard definition). The query language used to express the original query and the one for the resulting query will be defined in classes extending this one. For instance a SQLtoLDAPQueryTranslator would implement the virtual methods here defined for the SQL query language as input an LDAP query language as output.

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

Definition at line 30 of file QueryTranslator.h.


Constructor & Destructor Documentation

QueryTranslator::QueryTranslator  
 

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

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

Definition at line 13 of file QueryTranslator.cpp.

References LcgInfo::int2str, mMap, mOurMap, mTRowT, and LcgConfigBuffer::ConfigBuffer::populate_from_config.

QueryTranslator::QueryTranslator 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 QueryTranslator.cpp.

References LcgInfo::int2str, mMap, mOurMap, mTRowT, and LcgConfigBuffer::ConfigBuffer::populate_from_config.

QueryTranslator::QueryTranslator 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 43 of file QueryTranslator.cpp.

References mMap, mOurMap, and mTRowT.


Member Function Documentation

virtual std::vector<std::string> LcgInfo::QueryTranslator::translateQuery std::string const &    pQueryCanonical [pure virtual]
 

Translates the specified query (intended to be posed to the canonical schema) into some new queries that can be posed to the implementation specific schema (in order) to retrieve the same information.

Several queries may be needed for cases where the output language does not support joins. In that case, queries refer to the results of the others by "n#", where "n" is the query number. It may throw a QueryTranslationException if there are problems parsing the specified predicate

Parameters:
pQueryCanonical  the query to be translated
Returns:
the resulting translated queries

Implemented in LcgInfo::SQLQueryTranslator.


Member Data Documentation

LcgConfigBuffer::ConfigBuffer* LcgInfo::QueryTranslator::mMap [protected]
 

A pointer to the object that reads the mapping file and holds the information there contained.

The object itself can be instantiated by default inside this class, or can be instantiated in an external one.

Definition at line 88 of file QueryTranslator.h.

Referenced by QueryTranslator, and ~QueryTranslator.

TableRowTranslator* LcgInfo::QueryTranslator::mTRowT [protected]
 

A pointer to the object that can perform the translation between the canonical names and the implementation ones.

It uses the mMap pointer to perform this translations. The object itself can be instantiated by default inside this class, or can be instantiated in an external one.

Definition at line 103 of file QueryTranslator.h.

Referenced by QueryTranslator, LcgInfo::SQLQueryTranslator::translateSemantic, and ~QueryTranslator.


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