rasdaman complete source
qtcondenseop.hh
Go to the documentation of this file.
1 #ifndef _QTCONDENSEOP_
2 #define _QTCONDENSEOP_
3 
4 #ifndef CPPSTDLIB
5 #include <ospace/string.h> // STL<ToolKit>
6 #else
7 #include <string>
8 #endif
9 
11 
12 #include "catalogmgr/ops.hh"
13 #include <stdio.h>
14 
15 /*
16 * This file is part of rasdaman community.
17 *
18 * Rasdaman community is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
22 *
23 * Rasdaman community is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
30 *
31 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
32 rasdaman GmbH.
33 *
34 * For more information please see <http://www.rasdaman.org>
35 * or contact Peter Baumann via <baumann@rasdaman.com>.
36 */
37 /*************************************************************
38  *
39  *
40  * COMMENTS:
41  *
42  ************************************************************/
43 
44 //@ManMemo: Module: {\bf qlparser}
45 
46 /*@Doc:
47 
48  The class represents the root of a cond expression.
49 
50 */
51 
53 {
54 public:
56  QtCondenseOp( Ops::OpType newOperation,
57  const std::string& initIteratorName,
58  QtOperation* mintervalExp,
59  QtOperation* cellExp,
60  QtOperation* condExp = NULL );
61 
63  ~QtCondenseOp();
64 
66  virtual QtNodeList* getChilds( QtChildType flag );
67 
69  virtual bool equalMeaning( QtNode* node );
70 
72  virtual std::string getSpelling();
73 
75  virtual void setInput( QtOperation* inputOld, QtOperation* inputNew );
76 
78  void optimizeLoad( QtTrimList* trimList );
79 
81  virtual void simplify();
82 
84  virtual bool isCommutative() const;
85 
87  QtData* evaluate( QtDataList* inputList );
91  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
93 
95  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
96 
97  //@Man: Read/Write methods:
99 
102  inline QtOperation* getCondOp();
103 
105 
106 
108  inline virtual const QtNodeType getNodeType() const;
109 
111  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
112 
113 private:
115  static const QtNodeType nodeType;
116 
118  std::string iteratorName;
119 
121  QtOperation* condOp;
122 
124  Ops::OpType operation;
125 };
126 
127 
128 #include "qlparser/qtcondenseop.icc"
129 
130 #endif
131 
Definition: qtcondenseop.hh:52
std::list< QtNode * > QtNodeList
list of QtNode pointers
Definition: qtnode.hh:91
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
std::vector< QtTrimElement * > QtTrimList
list of QtTrimData structures
Definition: qtnode.hh:88
Definition: qtnode.hh:463
QtCondenseOp(Ops::OpType newOperation, const std::string &initIteratorName, QtOperation *mintervalExp, QtOperation *cellExp, QtOperation *condExp=NULL)
constructor getting iterator, minterval exp, cell exp, and cell condition exp (optional) ...
Definition: qtdata.hh:83
QtOperation * getCondOp()
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
QtChildType
Definition: qtnode.hh:186
~QtCondenseOp()
virtual destructor
QtNodeType
Definition: qtnode.hh:93
Definition: qtnode.hh:394
virtual std::string getSpelling()
creates a unique name for a common subexpression
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
virtual QtNodeList * getChilds(QtChildType flag)
return childs of the node
virtual void simplify()
simplifies the tree
virtual bool isCommutative() const
returns FALSE saying that the operation IS NOT commutative
Definition: qtbinaryoperation.hh:52
virtual const QtNodeType getNodeType() const
method for identification of nodes
Definition: qtnode.hh:73
virtual void setInput(QtOperation *inputOld, QtOperation *inputNew)
method for query rewrite
Definition: qtoperation.hh:57
virtual bool equalMeaning(QtNode *node)
test if the two nodes have an equal meaning in a subtree
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
void optimizeLoad(QtTrimList *trimList)
optimizing load access
Definition: qtnode.hh:190