rasdaman complete source
qtcondense.hh
Go to the documentation of this file.
1 #ifndef _QTCONDENSE_
2 #define _QTCONDENSE_
3 
5 #include "raslib/minterval.hh"
6 #include "catalogmgr/ops.hh"
7 
8 /*
9 * This file is part of rasdaman community.
10 *
11 * Rasdaman community is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * Rasdaman community is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
23 *
24 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
25 rasdaman GmbH.
26 *
27 * For more information please see <http://www.rasdaman.org>
28 * or contact Peter Baumann via <baumann@rasdaman.com>.
29 */
30 /**************************************************************
31  *
32  *
33  * COMMENTS:
34  *
35  ************************************************************/
36 
37 //@ManMemo: Module: {\bf qlparser}
38 
39 /*@Doc:
40 
41  The class represents a condense operation in the query tree.
42 
43 */
44 
46 {
47 public:
49  QtCondense( Ops::OpType newOpType);
50 
52  QtCondense( Ops::OpType newOpType, QtOperation* input );
53 
55  QtData* computeFullCondense( QtDataList* inputList, r_Minterval& areaOp);// = r_Minterval() );
56 
58  virtual QtAreaType getAreaType();
59 
61  virtual void optimizeLoad( QtTrimList* trimList );
69  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
71 
73  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
74 
76  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
77 
79  inline virtual const char* getClassName() const;
80 
82  inline virtual const char* getAlgebraicName() const;
83 
84 protected:
86  Ops::OpType opType;
87 
88 private:
90  static const QtNodeType nodeType;
91 };
92 
93 
94 
95 
96 //@ManMemo: Module: {\bf qlparser}
97 
98 /*@Doc:
99 
100  The class represents the specialized condenser {\tt some_cells()} in the query tree.
101 
102 */
103 
104 class QtSome : public QtCondense
105 {
106 public:
108  QtSome();
109 
112 
114  QtData* evaluate( QtDataList* inputList );
115 
117  inline virtual const QtNodeType getNodeType() const;
118 
120  inline virtual const char* getClassName() const;
121 
123  inline virtual const char* getAlgebraicName() const;
124 
125 private:
127  static const QtNodeType nodeType;
128 };
129 
130 
131 
132 //@ManMemo: Module: {\bf qlparser}
133 
134 /*@Doc:
135 
136  The class represents the specialized condenser {\tt all_cells()} in the query tree.
137 
138 */
139 
140 class QtAll : public QtCondense
141 {
142 public:
144  QtAll();
145 
147  QtAll( QtOperation* input );
148 
150  QtData* evaluate( QtDataList* inputList );
151 
153  inline virtual const QtNodeType getNodeType() const;
154 
156  inline virtual const char* getClassName() const;
157 
159  inline virtual const char* getAlgebraicName() const;
160 
161 private:
163  static const QtNodeType nodeType;
164 };
165 
166 
167 
168 //@ManMemo: Module: {\bf qlparser}
169 
170 /*@Doc:
171 
172  The class represents the specialized condenser {\tt count_cells()} in the query tree.
173 
174 */
175 
176 class QtCountCells : public QtCondense
177 {
178 public:
180  QtCountCells();
181 
184 
186  QtData* evaluate( QtDataList* inputList );
187 
189  inline virtual const QtNodeType getNodeType() const;
190 
192  inline virtual const char* getClassName() const;
193 
195  inline virtual const char* getAlgebraicName() const;
196 
197 private:
199  static const QtNodeType nodeType;
200 };
201 
202 
203 //@ManMemo: Module: {\bf qlparser}
204 
205 /*@Doc:
206 
207  The class represents the specialized condenser {\tt add_cells()} in the query tree.
208 
209 */
210 
211 class QtAddCells : public QtCondense
212 {
213 public:
215  QtAddCells();
216 
219 
221  QtData* evaluate( QtDataList* inputList );
222 
224  inline virtual const QtNodeType getNodeType() const;
225 
227  inline virtual const char* getClassName() const;
228 
230  inline virtual const char* getAlgebraicName() const;
231 
232 private:
234  static const QtNodeType nodeType;
235 };
236 
237 
238 //@ManMemo: Module: {\bf qlparser}
239 
240 /*@Doc:
241 
242  The class represents the specialized condenser {\tt avg_cells()} in the query tree.
243 
244 */
245 
246 class QtAvgCells : public QtCondense
247 {
248 public:
250  QtAvgCells();
251 
254 
256  QtData* evaluate( QtDataList* inputList );
257 
259  inline virtual const QtNodeType getNodeType() const;
260 
262  inline virtual const char* getClassName() const;
263 
265  inline virtual const char* getAlgebraicName() const;
266 
267 private:
269  static const QtNodeType nodeType;
270 };
271 
272 
273 //@ManMemo: Module: {\bf qlparser}
274 
275 /*@Doc:
276 
277  The class represents the specialized condenser {\tt min_cells()} in the query tree.
278 
279 */
280 
281 class QtMinCells : public QtCondense
282 {
283 public:
285  QtMinCells();
286 
289 
291  QtData* evaluate( QtDataList* inputList );
292 
294  inline virtual const QtNodeType getNodeType() const;
295 
297  inline virtual const char* getClassName() const;
298 
300  inline virtual const char* getAlgebraicName() const;
301 
302 private:
304  static const QtNodeType nodeType;
305 };
306 
307 
308 //@ManMemo: Module: {\bf qlparser}
309 
310 /*@Doc:
311 
312  The class represents the specialized condenser {\tt max_cells()} in the query tree.
313 
314 */
315 
316 class QtMaxCells : public QtCondense
317 {
318 public:
320  QtMaxCells();
321 
324 
326  QtData* evaluate( QtDataList* inputList );
327 
329  inline virtual const QtNodeType getNodeType() const;
330 
332  inline virtual const char* getClassName() const;
333 
335  inline virtual const char* getAlgebraicName() const;
336 
337 private:
339  static const QtNodeType nodeType;
340 };
341 
342 
343 #include "qlparser/qtcondense.icc"
344 
345 #endif
346 
virtual const char * getClassName() const
method returning class name
QtCondense(Ops::OpType newOpType)
constructor getting operation
virtual const char * getAlgebraicName() const
method returning algebraic identifier
virtual const QtNodeType getNodeType() const
method for identification of nodes
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
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
Definition: qtcondense.hh:281
Definition: qtnode.hh:463
virtual const char * getAlgebraicName() const
method returning algebraic identifier
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
virtual const char * getAlgebraicName() const
method returning algebraic identifier
virtual const char * getClassName() const
method returning class name
virtual const char * getAlgebraicName() const
method returning algebraic identifier
Definition: qtdata.hh:83
QtOperation * input
operation operand
Definition: qtunaryoperation.hh:105
QtAddCells()
default constructor
Definition: qtcondense.hh:140
virtual const char * getAlgebraicName() const
method returning algebraic identifier
QtAvgCells()
default constructor
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
QtChildType
Definition: qtnode.hh:186
QtNodeType
Definition: qtnode.hh:93
Definition: qtnode.hh:394
QtMinCells()
default constructor
virtual const char * getClassName() const
method returning class name
Definition: qtcondense.hh:45
Definition: qtcondense.hh:246
virtual const char * getClassName() const
method returning class name
Definition: qtcondense.hh:104
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
virtual const char * getAlgebraicName() const
method returning algebraic identifier
Definition: qtunaryoperation.hh:52
virtual const QtNodeType getNodeType() const
method for identification of nodes
QtMaxCells()
default constructor
QtData * computeFullCondense(QtDataList *inputList, r_Minterval &areaOp)
method for computing full condense operation (without early termination option)
virtual const QtNodeType getNodeType() const
method for identification of nodes
virtual void optimizeLoad(QtTrimList *trimList)
optimizing load access
Definition: qtcondense.hh:176
QtCountCells()
default constructor
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
QtAll()
default constructor
virtual const QtNodeType getNodeType() const
method for identification of nodes
Ops::OpType opType
operation type
Definition: qtcondense.hh:86
virtual const QtNodeType getNodeType() const
method for identification of nodes
virtual const char * getClassName() const
method returning class name
QtSome()
default constructor
virtual const char * getAlgebraicName() const
method returning algebraic identifier
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
Definition: qtcondense.hh:211
Definition: qtoperation.hh:57
virtual const char * getClassName() const
method returning class name
Definition: qtcondense.hh:316
virtual const char * getClassName() const
method returning class name
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
Definition: qtnode.hh:190
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
virtual const char * getClassName() const
method returning class name
virtual const char * getAlgebraicName() const
method returning algebraic identifier
virtual const QtNodeType getNodeType() const
method for identification of nodes
virtual QtAreaType getAreaType()
test if the edge to the parent node is of type mdd or atomic
virtual const QtNodeType getNodeType() const
method for identification of nodes
QtData * evaluate(QtDataList *inputList)
method for evaluating the node