rasdaman complete source
qtselectioniterator.hh
Go to the documentation of this file.
1 #ifndef _QTSELECTIONITERATOR_
2 #define _QTSELECTIONITERATOR_
3 
4 #ifndef CPPSTDLIB
5 #include <ospace/string.h> // STL<ToolKit>
6 #else
7 #include <string>
8 #endif
9 
10 #include "qlparser/qtiterator.hh"
11 #include "qlparser/qtoperation.hh"
12 
13 /*
14 * This file is part of rasdaman community.
15 *
16 * Rasdaman community is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * Rasdaman community is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
28 *
29 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
30 rasdaman GmbH.
31 *
32 * For more information please see <http://www.rasdaman.org>
33 * or contact Peter Baumann via <baumann@rasdaman.com>.
34 */
35 /*************************************************************
36  *
37  *
38  * COMMENTS:
39  *
40  ************************************************************/
41 
42 //@ManMemo: Module: {\bf qlparser}
43 
44 /*@Doc:
45 
46 An condition expression specified through a reference to
47 an instance of the QtOperation sub-hierarchy, is evaluated for the actual input
48 The boolean result determines if the tupel is passed to the output stream or not.
49 So the method {\tt next()} reads tupels from its inputs until one can be
50 passed to its caller. The class represents the WHERE condition in the query
51 
52 */
53 
55 {
56 public:
59 
61  QtSelectionIterator( QtNode* node );
62 
64  virtual ~QtSelectionIterator();
65 
67  virtual QtNodeList* getChilds( QtChildType flag );
68 
70  inline virtual void setInput( QtOperation* child, QtOperation* input);
71 
73 // virtual void preOptimize();
79  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
81 
83  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
84 
85  //@Man: Operations of the ONC protocol:
87  QtDataList* next();
90 
91  //@Man: Read/Write methods:
93  //inline virtual void setParents();
96  inline void setConditionTree( QtOperation* operation );
98  inline QtOperation* getConditionTree();
100 
102  inline virtual const QtNodeType getNodeType() const;
103 
105  virtual const QtTypeTuple& checkType();
106 
107 private:
109  QtOperation* conditionTree;
110 
112  static const QtNodeType nodeType;
113 };
114 
115 #include "qlparser/qtselectioniterator.icc"
116 
117 #endif
118 
119 
std::list< QtNode * > QtNodeList
list of QtNode pointers
Definition: qtnode.hh:91
Definition: qtiterator.hh:50
void setConditionTree(QtOperation *operation)
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
Definition: qtnode.hh:463
QtSelectionIterator()
default constructor
QtDataList * next()
QtChildType
Definition: qtnode.hh:186
QtNodeType
Definition: qtnode.hh:93
Definition: qtselectioniterator.hh:54
QtOperation * getConditionTree()
virtual ~QtSelectionIterator()
virtual destructor
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
optimizing load access
virtual QtNodeList * getChilds(QtChildType flag)
return childs of the node
virtual void setInput(QtOperation *child, QtOperation *input)
method for query rewrite
Definition: qtnode.hh:73
virtual const QtNodeType getNodeType() const
method for identification of nodes
virtual const QtTypeTuple & checkType()
type checking
Definition: qtoperation.hh:57
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
Definition: qtnode.hh:190