#include <SQLtoLDAPPredicateTree.h>
Inheritance diagram for LcgInfo::SQLtoLDAPPredicateTree:
Public Methods | |
SQLtoLDAPPredicateTree () | |
Constructor of the class. More... | |
virtual | ~SQLtoLDAPPredicateTree () |
Destructor of the class. | |
SQLtoLDAPPredicateTree * | create () |
Creates a new node of the type of this node (SQLtoLDAPPredicateTree). More... | |
virtual SQLtoLDAPPredicateTree * | clone () |
Recursively copies this node and all the nodes below it. More... | |
virtual std::string | evaluate (std::vector< std::string > &pQueries) |
Returns a vector of strings with the predicate that would result of the evaluation this node and all its descendents (last position), and all the necessary intermediate ldapsearch calls that would be needed to complete the predicate. More... |
Each object is a node linked to its two children nodes (left and right). This class extends the PredicateTree, and overloads the evaluate() and translate() methods, so that the first returns a query in SQL-format and the second one makes the appropriate table.row name translations and adds the necessary AND sub-predicates.
Definition at line 24 of file SQLtoLDAPPredicateTree.h.
|
Constructor of the class. It just creates an empty object. Definition at line 14 of file SQLtoLDAPPredicateTree.cpp. |
|
Recursively copies this node and all the nodes below it. The resulting object's dynamic type will be that of this class. It is a trick (similar to a virtual copy constructor) used to allow the recursive copy of the tree.
Implements LcgInfo::SQLPredicateTree. Definition at line 25 of file SQLtoLDAPPredicateTree.cpp. References create, LcgInfo::PredicateTree::depth, LcgInfo::PredicateTree::left, LcgInfo::PredicateTree::right, SQLtoLDAPPredicateTree, LcgInfo::PredicateTree::type, and LcgInfo::PredicateTree::value. |
|
Creates a new node of the type of this node (SQLtoLDAPPredicateTree). It uses some default values (in order to use a template, use the PredicateTree::clone() method). It is a trick (virtual constructor) used to allow the recursive creation of the tree when inserting predicates. It overloads a method of the SQLPredicaTree class.
Implements LcgInfo::SQLPredicateTree. Definition at line 21 of file SQLtoLDAPPredicateTree.cpp. References SQLtoLDAPPredicateTree. Referenced by clone. |
|
Returns a vector of strings with the predicate that would result of the evaluation this node and all its descendents (last position), and all the necessary intermediate ldapsearch calls that would be needed to complete the predicate. The results of one query in position "n" should be included in another query as indicated by the macro "n#", which can be escaped by using "\" before the "#". It composes a global predicate ordering the predicates in a prefix expression for BOOLEAN nodes and an infix one for COMPARISON nodes (LDAP like). It may throw a QueryTranslationException if the node (or one of its children) cannot be parsed properly.
Implements LcgInfo::SQLPredicateTree. Definition at line 46 of file SQLtoLDAPPredicateTree.cpp. References LcgInfo::PredicateTree::depth, LcgInfo::int2str, LcgInfo::isLiteral, LcgInfo::isNumber, LcgInfo::PredicateTree::left, LcgInfo::nocaseCompare, LcgInfo::PredicateTree::right, LcgInfo::PredicateTree::type, and LcgInfo::PredicateTree::value. |