rasdaman complete source
qtconst.hh
Go to the documentation of this file.
1 #ifndef _QTCONST_
2 #define _QTCONST_
3 
4 #ifndef CPPSTDLIB
5 #include <ospace/string.h> // STL<ToolKit>
6 #else
7 #include <string>
8 #endif
9 
10 #include "qlparser/qtdata.hh"
11 #include "qlparser/qtoperation.hh"
12 #include <stdio.h>
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 a carrier for a {\tt QtData} object
48  and, additionally, provides functionality necessary in
49  the query tree.
50 
51 */
52 
53 class QtConst : public QtOperation
54 {
55 public:
57  QtConst( QtData* newDataObj );
62  virtual ~QtConst();
64 
66  virtual bool equalMeaning( QtNode* node );
67 
69  virtual std::string getSpelling();
70 
72  virtual QtAreaType getAreaType();
73 
75  virtual void optimizeLoad( QtTrimList* trimList );
76 
78  QtData* evaluate( QtDataList* inputList );
79 
81  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
82 
84  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
85 
87  inline virtual const QtNodeType getNodeType() const;
88 
89  //@Man: Operations of the ONC protocol:
91  QtDataList* next();
94 
95  //@Man: Read/Write methods:
97  inline QtData* getDataObj();
101 
102 
104  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
105 
106 private:
108  QtData* dataObj;
109 
111  static const QtNodeType nodeType;
112 };
113 
114 #include "qlparser/qtconst.icc"
115 
116 #endif
117 
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 ~QtConst()
virtual destructor
Definition: qtnode.hh:463
virtual bool equalMeaning(QtNode *node)
test if the two nodes have an equal meaning in the query tree
Definition: qtdata.hh:83
virtual std::string getSpelling()
creates a unique name for a common subexpression
QtChildType
Definition: qtnode.hh:186
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
QtNodeType
Definition: qtnode.hh:93
Definition: qtnode.hh:394
virtual QtAreaType getAreaType()
test if the edge to the parent node is of type mdd or atomic
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
virtual void optimizeLoad(QtTrimList *trimList)
optimizing load access
Definition: qtconst.hh:53
Definition: qtnode.hh:73
QtData * evaluate(QtDataList *inputList)
method for evaluating the node
Definition: qtoperation.hh:57
QtConst(QtData *newDataObj)
constructor getting a pointer to the data object
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
Definition: qtnode.hh:190
virtual const QtNodeType getNodeType() const
method for identification of nodes
QtData * getDataObj()
return the data object
QtDataList * next()