rasdaman complete source
qtvariable.hh
Go to the documentation of this file.
1 #ifndef _QTVARIABLE_
2 #define _QTVARIABLE_
3 
5 #include "raslib/minterval.hh"
6 
7 #ifndef CPPSTDLIB
8 #include <ospace/string.h> // STL<ToolKit>
9 #else
10 #include <string>
11 #endif
12 
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 stands for a MDD variable which corresponds to an element of the
49  tupel passed by the evaluate() method.
50 
51 */
52 
53 
54 class QtVariable : public QtOperation
55 {
56 public:
58  QtVariable( const std::string& iteratorName );
59 
61  QtVariable( const std::string& iteratorName, const r_Minterval& loadDomain );
62 
64  virtual ~QtVariable();
65 
67  virtual bool equalMeaning( QtNode* node );
68 
70  virtual std::string getSpelling();
71 
73  virtual QtAreaType getAreaType();
74 
76  void optimizeLoad( QtTrimList* trimList );
77 
79  QtData* evaluate( QtDataList* inputList ) throw (ParseInfo);
80 
82  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
83 
85  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
86 
88  inline const std::string getIteratorName() const;
89  inline void setIteratorName( std::string& str );
90 
92  inline const r_Minterval getLoadDomain() const;
93 
95  inline void setLoadDomain( r_Minterval& loadDomain );
96 
98  inline void setOldLoadDomain();
99 
101  inline const r_Minterval getOldLoadDomain();
102 
104  inline vector<bool>* getLoadDomainFlag();
105 
107  inline virtual const QtNodeType getNodeType() const;
108 
110  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL ) throw (ParseInfo);
111 
112 private:
113 
115  std::string iteratorName;
116 
118  r_Minterval loadDomain;
119 
121  r_Minterval oldLoadDomain;
122 
124  vector<bool>* domainFlag;
125 
127  int dataIndex;
128 
130  static const QtNodeType nodeType;
131 };
132 
133 #include "qlparser/qtvariable.icc"
134 
135 #endif
136 
const r_Minterval getLoadDomain() const
method for loadDomain
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
std::vector< QtTrimElement * > QtTrimList
list of QtTrimData structures
Definition: qtnode.hh:88
QtAreaType
Definition: qtnode.hh:180
Definition: qtnode.hh:463
Definition: parseinfo.hh:51
const std::string getIteratorName() const
methods for iterator name
Definition: qtdata.hh:83
QtChildType
Definition: qtnode.hh:186
QtNodeType
Definition: qtnode.hh:93
Definition: qtnode.hh:394
virtual ~QtVariable()
destructor
const r_Minterval getOldLoadDomain()
method for oldLoadDomain
Definition: qtvariable.hh:54
void setOldLoadDomain()
method for oldLoadDomain
QtVariable(const std::string &iteratorName)
constructor getting iterator variable name
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
void setLoadDomain(r_Minterval &loadDomain)
method for loadDomain
void setIteratorName(std::string &str)
virtual bool equalMeaning(QtNode *node)
test if the two nodes have an equal meaning in the query tree
virtual const QtNodeType getNodeType() const
method for identification of nodes
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
Definition: qtnode.hh:73
Definition: qtoperation.hh:57
vector< bool > * getLoadDomainFlag()
method for LoadDomain
virtual QtAreaType getAreaType()
test if the edge to the parent node is of type mdd or atomic
Definition: qtnode.hh:190
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
virtual std::string getSpelling()
creates a unique name for a common subexpression
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
void optimizeLoad(QtTrimList *trimList)
optimizing load access