rasdaman complete source
qtnaryoperation.hh
Go to the documentation of this file.
1 #ifndef _QTNARYOPERATION_
2 #define _QTNARYOPERATION_
3 
4 #ifndef CPPSTDLIB
5 #include <ospace/string.h> // STL<ToolKit>
6 #else
7 #include <string>
8 #endif
9 
10 #include <stdio.h>
11 
12 #include "qlparser/qtoperation.hh"
13 
14 /*
15 * This file is part of rasdaman community.
16 *
17 * Rasdaman community is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * Rasdaman community is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
29 *
30 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
31 rasdaman GmbH.
32 *
33 * For more information please see <http://www.rasdaman.org>
34 * or contact Peter Baumann via <baumann@rasdaman.com>.
35 */
36 /**************************************************************
37  *
38  *
39  * COMMENTS:
40  *
41  ************************************************************/
42 
43 //@ManMemo: Module: {\bf qlparser}
44 
45 /*@Doc:
46 
47  The class serves as superclass for all operation classes taking n
48  (more than two) arguments.
49 
50 */
51 
53 {
54 public:
57 
59  QtNaryOperation( QtNode* node );
60 
63 
65  virtual ~QtNaryOperation();
66 
68  virtual void simplify();
69 
71  virtual bool equalMeaning( QtNode* node );
77  virtual QtNodeList* getChilds( QtChildType flag );
79 
81  virtual std::string getSpelling();
82 
84  virtual void setInput( QtOperation*, QtOperation* inputNew );
85 
87  virtual QtAreaType getAreaType();
88 
90  virtual void optimizeLoad( QtTrimList* trimList );
96  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
98 
100  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
101 
102  //@Man: read/write methods for the operands
104  inline void setInputs( QtOperationList* opList );
110 
111 
112 protected:
114  bool getOperands( QtDataList* inputList, QtDataList* &operandList );
124 
125 private:
127  static const QtNodeType nodeType;
128 };
129 
130 #include "qlparser/qtnaryoperation.icc"
131 
132 #endif
133 
134 
bool getOperands(QtDataList *inputList, QtDataList *&operandList)
method for testing and evaluating the input branches
std::list< QtNode * > QtNodeList
list of QtNode pointers
Definition: qtnode.hh:91
virtual void optimizeLoad(QtTrimList *trimList)
optimizing load access
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
std::vector< QtTrimElement * > QtTrimList
list of QtTrimData structures
Definition: qtnode.hh:88
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
debugging method
QtAreaType
Definition: qtnode.hh:180
QtNode::QtOperationList * getInputs()
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
QtNaryOperation()
default constructor
QtOperationList * operationList
operation trees
Definition: qtnaryoperation.hh:123
QtChildType
Definition: qtnode.hh:186
QtNodeType
Definition: qtnode.hh:93
Definition: qtnaryoperation.hh:52
virtual QtNodeList * getChilds(QtChildType flag)
return childs of the node
virtual QtAreaType getAreaType()
tests if the edge to the parent node is of type mdd or atomic
Definition: qtnode.hh:73
void setInputs(QtOperationList *opList)
Definition: qtoperation.hh:57
virtual void setInput(QtOperation *, QtOperation *inputNew)
method for query rewrite
virtual ~QtNaryOperation()
virtual destructor
std::vector< QtOperation * > QtOperationList
list of QtOperation pointers
Definition: qtnode.hh:194
Definition: qtnode.hh:190
virtual std::string getSpelling()
creates a unique name for a subexpression
virtual void simplify()
simplifies the tree
virtual bool equalMeaning(QtNode *node)
test if the two nodes have an equal meaning in the query tree