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

LcgInfo Namespace Reference

Groups the classes and methods needed to build a generic API to the LCG Information System. More...


Compounds

class  LcgInfo::LcgInfoException
 This class is used for exceptions when using the LcgInfoInterface class. More...

class  LcgInfo::LcgInfoInterface
 Main class of the generic API to the LCG Information System. More...

class  LcgInfo::PredicateTree
 This class implements a binary tree of nodes that stores a logical predicate composed of boolean and comparison operators, and leaf elements. More...

class  LcgInfo::Querier
 This class (actually, extending ones, since this is not instantiable) is used to pose a query expressed in terms of the canonical schema, to the desired implementation specific information system. More...

class  LcgInfo::QueryTranslationException
 This class is used for exceptions when translating. More...

class  LcgInfo::QueryTranslator
 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...

class  LcgInfo::SQLPredicateTree
 This class is the base for those implementing a binary tree of nodes that stores a SQL "WHERE predicate". More...

class  LcgInfo::SQLQueryTranslator
 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...

class  LcgInfo::SQLtoLDAPPredicateTree
 This class implements a binary tree of nodes that stores a SQL "WHERE predicate". More...

class  LcgInfo::SQLtoLDAPQuerier
 This class is used to pose a SQL query expressed in terms of the canonical schema, to the implementated LDAP information system. More...

class  LcgInfo::SQLtoLDAPQueryTranslator
 This class implements the translation from a original SQL query to a LDAP one. More...

class  LcgInfo::SQLtoSQLPredicateTree
 This class implements a binary tree of nodes that stores a SQL "WHERE predicate", that can translate it to a new schema, and that can evaluate it, outputing a SQL string. More...

class  LcgInfo::SQLtoSQLQuerier
 This class is used to pose a SQL query expressed in terms of the canonical schema, to the implementated SQL information system. More...

class  LcgInfo::SQLtoSQLQueryTranslator
 This class is used to translate an SQL query posed to a canonical relational schema into a new SQL query that can be posed to an equivalent schema (i.e.: containing the same actual information), in order to retrieve the same information. More...

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


Typedefs

typedef Queriercreate_Querier ()
 A function returning a pointer to a Querier object. More...

typedef void destroy_Querier (Querier *)
 A function accepting a pointer to a Querier object and returning nothing. More...


Functions

void tokenizeStr (std::string const &pStr, std::vector< std::string > &pTokens, std::string const &pDelimiters="\t")
 Splits pStr into tokens delimited by the characters contained in the pDelimiters string. More...

void tokenizeStrWithIndices (std::string const &pStr, std::vector< std::string > &pTokens, std::vector< short int > &pIndices, std::string const &pDelimiters="\t")
 Splits pStr into tokens delimited by the characters contained in the pDelimiters string. More...

void delLeadingChars (std::string &pStr, std::string const &pChars="\t")
 Erases all the characters until the first character of pStr that is not contained in the pChars string. More...

void delEndingChars (std::string &pStr, std::string const &pChars="\t")
 Erases the last characters of pStr that are contained in the pChars string, until the first that is not contained. More...

void delSurroundingChars (std::string &pStr, std::string const &pChars="\t")
 Erases the first and last characters of pStr that are contained in the pChars string, until the first (and last) that is not contained. More...

bool nocaseCompare (std::string const &pStr1, std::string const &pStr2)
 Compares two strings ignoring the case of their letters, and returns true if they are equal and false otherwise. More...

bool isNumber (std::string const &pStr)
 Checks if the specified string is a well-formed number. More...

bool isLiteral (std::string const &pStr)
 Checks if the specified string is a literal; i.e. More...

std::string int2str (int const &pVal)
 Returns a string representing the specified int value. More...

int str2int (std::string const &pStr)
 Returns an int for which the specified string is a representation. More...

void escapeLiterals (std::string &pStr, std::string const &pChars="\t", char const &pEscape='\\', char const &pDelimiter='\'')
 Looks for literals (substrings delimited by pDelimiter) in pStr, and inside them, escapes the specified pChars by adding the pEscape char before them.

void unescapeLiterals (std::string &pStr, std::string const &pChars="\t", char const &pEscape='\\', char const &pDelimiter='\'')
 Looks for literals (substrings delimited by pDelimiter) in pStr, and inside them, findes the specified pChars that are escaped by the pEscape char, and delete that pEscape char (unescapes them).

std::string extractTable (std::string const &pStr)
 Extracts the table name of the specified table.row string. More...

std::string extractRow (std::string const &pStr)
 Extracts the row name of the specified table.row string. More...


Detailed Description

Groups the classes and methods needed to build a generic API to the LCG Information System.

The main class is the LcgInfoInterface which uses the libfactory::LibFactory class to load the appropriate Querier object (actually a class extending that abstract one) from a dynamic library. The Querier objects contain QueryTranslator objects and interfaces. The first translate the original query (created to be posed against a canonical view of the information schema of the system) to one that can be posed to the implementation specific information system (can be LDAP, SQL...). The interface effectively poses the queries. These classes (and some auxiliary ones) are all under the LcgInfo namespace. The LcgConfigBuffer::ConfigBuffer class is also used as the reader and container of the configuration information.


Typedef Documentation

typedef Querier* LcgInfo::create_Querier()
 

A function returning a pointer to a Querier object.

This is the type of the method that creates the actual Querier object (of an extending class), and that has to be implemented as external to make it loadable by libfactory::LibFactory

Definition at line 83 of file Querier.h.

Referenced by LcgInfo::LcgInfoInterface::connect.

typedef void LcgInfo::destroy_Querier(Querier*)
 

A function accepting a pointer to a Querier object and returning nothing.

This is the type of the method that destroy a Querier object (of an extending class), and that has to be implemented as external to make it loadable by libfactory::LibFactory

Definition at line 91 of file Querier.h.

Referenced by LcgInfo::LcgInfoInterface::connect.


Function Documentation

void LcgInfo::delEndingChars std::string &    pStr,
std::string const &    pChars = "\t"
 

Erases the last characters of pStr that are contained in the pChars string, until the first that is not contained.

See also:
delLeadingChars , delSurroundingChars
Parameters:
pStr  the string from where the characters are to be removed
pChars  a string containing the characters that have to be removed

Definition at line 58 of file TranslatorsUtils.cpp.

void LcgInfo::delLeadingChars std::string &    pStr,
std::string const &    pChars = "\t"
 

Erases all the characters until the first character of pStr that is not contained in the pChars string.

See also:
delEndingChars , delSurroundingChars
Parameters:
pStr  the string from where the characters are to be removed
pChars  a string containing the characters that have to be removed

Definition at line 53 of file TranslatorsUtils.cpp.

void LcgInfo::delSurroundingChars std::string &    pStr,
std::string const &    pChars = "\t"
 

Erases the first and last characters of pStr that are contained in the pChars string, until the first (and last) that is not contained.

See also:
delLeadingChars , delEndingChars
Parameters:
pStr  the string from where the characters are to be removed
pChars  a string containing the characters that have to be removed

Definition at line 64 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::SQLPredicateTree::insertPredicate, and LcgInfo::TableRowTranslator::mapTableRow.

string LcgInfo::extractRow std::string const &    pStr
 

Extracts the row name of the specified table.row string.

It just returns the part that is after the last point of the string.

Definition at line 177 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::SQLtoLDAPQueryTranslator::translateQuery.

string LcgInfo::extractTable std::string const &    pStr
 

Extracts the table name of the specified table.row string.

It just removes the part that is after the last point of the string, and that last point itself.

Definition at line 171 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::PredicateTree::addAndPredicate, LcgInfo::PredicateTree::translate, LcgInfo::SQLtoLDAPQueryTranslator::translateQuery, and LcgInfo::SQLQueryTranslator::translateSemantic.

string LcgInfo::int2str int const &    pVal
 

Returns a string representing the specified int value.

Parameters:
pVal  the int to transform
Returns:
the string representation of the int

Definition at line 101 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::LcgInfoInterface::connect, LcgInfo::SQLtoSQLPredicateTree::evaluate, LcgInfo::SQLtoLDAPPredicateTree::evaluate, LcgInfo::SQLtoSQLQuerier::query, LcgInfo::SQLtoLDAPQuerier::query, LcgInfo::QueryTranslator::QueryTranslator, LcgInfo::SQLtoSQLQuerier::setConfig, LcgInfo::SQLtoLDAPQuerier::setConfig, LcgInfo::TableRowTranslator::TableRowTranslator, LcgInfo::PredicateTree::translate, LcgInfo::SQLtoLDAPQueryTranslator::translateQuery, and LcgInfo::SQLQueryTranslator::translateSemantic.

bool LcgInfo::isLiteral std::string const &    pStr
 

Checks if the specified string is a literal; i.e.

it is a string between double commas ("), possibly preceded and followed by some spaces or tabs.

Parameters:
pStr  the string to be analyzed
Returns:
true for a literal string, false otherwise

Definition at line 93 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::PredicateTree::addAndPredicate, LcgInfo::SQLtoLDAPPredicateTree::evaluate, LcgInfo::PredicateTree::relatesTables, and LcgInfo::PredicateTree::translate.

bool LcgInfo::isNumber std::string const &    pStr
 

Checks if the specified string is a well-formed number.

Parameters:
pStr  the string to be analyzed
Returns:
true for a number, false otherwise

Definition at line 85 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::PredicateTree::addAndPredicate, LcgInfo::SQLtoLDAPPredicateTree::evaluate, LcgInfo::PredicateTree::relatesTables, and LcgInfo::PredicateTree::translate.

bool LcgInfo::nocaseCompare std::string const &    pStr1,
std::string const &    pStr2
 

Compares two strings ignoring the case of their letters, and returns true if they are equal and false otherwise.

Parameters:
pStr1  the first of the strings to be compared
pStr2  the second of the strings to be compared

Definition at line 69 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::SQLtoSQLPredicateTree::evaluate, LcgInfo::SQLtoLDAPPredicateTree::evaluate, LcgInfo::PredicateTree::isBooleanOp, and LcgInfo::SQLQueryTranslator::translateSemantic.

int LcgInfo::str2int std::string const &    pStr
 

Returns an int for which the specified string is a representation.

Parameters:
pStr  the string to transform
Returns:
the int for which pStr is a representation

Definition at line 107 of file TranslatorsUtils.cpp.

Referenced by LcgInfo::SQLtoLDAPQuerier::query.

void tokenizeStr std::string const &    pStr,
std::vector< std::string > &    pTokens,
std::string const &    pDelimiters = "\t"
 

Splits pStr into tokens delimited by the characters contained in the pDelimiters string.

The result is returned as a vector of strings, whose elements are the tokens.

Parameters:
pStr  the string from where the characters are to be removed
pTokens  a vector where the resulting tokens will be stored
pDelimitirs  a string containing the characters that act as delimiters

Referenced by LcgInfo::PredicateTree::addAndPredicate, LcgInfo::TableRowTranslator::mapTableRow, and LcgInfo::SQLtoLDAPQuerier::query.

void tokenizeStrWithIndices std::string const &    pStr,
std::vector< std::string > &    pTokens,
std::vector< short int > &    pIndices,
std::string const &    pDelimiters = "\t"
 

Splits pStr into tokens delimited by the characters contained in the pDelimiters string.

The result is returned as a vector of strings, whose elements are the tokens, and a vectors of string:size_type variables, whose elements indicate the position of each of this tokens in the original string.

Parameters:
pStr  the string from where the characters are to be removed
pTokens  a vector where the resulting tokens will be stored
pIndices  a vector with the indices of the tokens in the original string
pDelimitirs  a string containing the characters that act as delimiters

Referenced by LcgInfo::SQLtoLDAPQueryTranslator::translateQuery, and LcgInfo::SQLQueryTranslator::translateSemantic.


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