rasdaman complete source
qtconversion.hh
Go to the documentation of this file.
1 #ifndef _QTCONVERSION_HH__
2 #define _QTCONVERSION_HH___
3 
5 
6 /*
7 * This file is part of rasdaman community.
8 *
9 * Rasdaman community is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * Rasdaman community is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
23 rasdaman GmbH.
24 *
25 * For more information please see <http://www.rasdaman.org>
26 * or contact Peter Baumann via <baumann@rasdaman.com>.
27 */
28 /*************************************************************
29  *
30  *
31  * COMMENTS:
32  *
33  ************************************************************/
34 
35 
36 //@ManMemo: Module: {\bf qlparser}
37 
38 /*@Doc:
39 
40  The class represents a format conversion. The conversion is described by
41  an enumerator.
42 
43 */
44 
46 {
47 public:
49  {
71  };
72 
74  QtConversion( QtOperation* newInput, QtConversionType newConversionType, const char* = NULL );
75 
77  void setConversionTypeByName( std::string formatName );
78 
80  static bool lookupConversionTypeByName( std::string formatName );
81 
83  virtual bool equalMeaning( QtNode* node );
84 
86  QtData* evaluate( QtDataList* inputList );
87 
89  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
90 
92  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
93 
95  inline virtual const QtNodeType getNodeType() const;
96 
98  virtual const QtTypeElement& checkType( QtTypeTuple* typeTuple = NULL );
99 
100 private:
102  QtConversionType conversionType;
103 
105  static const QtNodeType nodeType;
106 
107  const char* paramStr;
108 };
109 
110 extern std::ostream& operator<<(std::ostream& os, QtConversion::QtConversionType t);
111 
112 #include "qlparser/qtconversion.icc"
113 
114 #endif
115 
virtual const QtTypeElement & checkType(QtTypeTuple *typeTuple=NULL)
type checking of the subtree
virtual const QtNodeType getNodeType() const
method for identification of nodes
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
Definition: qtnode.hh:463
Definition: qtconversion.hh:55
Definition: qtconversion.hh:57
Definition: qtconversion.hh:58
Definition: qtconversion.hh:45
Definition: qtdata.hh:83
QtChildType
Definition: qtnode.hh:186
QtData * evaluate(QtDataList *inputList)
evaluates the node
QtNodeType
Definition: qtnode.hh:93
Definition: qtconversion.hh:68
Definition: qtnode.hh:394
Definition: qtconversion.hh:70
Definition: qtconversion.hh:61
std::ostream & operator<<(std::ostream &os, QtConversion::QtConversionType t)
Definition: qtunaryoperation.hh:52
Definition: qtconversion.hh:51
Definition: qtconversion.hh:60
QtConversionType
Definition: qtconversion.hh:48
Definition: qtconversion.hh:54
Definition: qtconversion.hh:53
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
static bool lookupConversionTypeByName(std::string formatName)
look up the format conversion type by name
Definition: qtconversion.hh:52
Definition: qtconversion.hh:69
Definition: qtconversion.hh:65
Definition: qtconversion.hh:62
Definition: qtnode.hh:73
Definition: qtconversion.hh:56
Definition: qtconversion.hh:67
QtConversion(QtOperation *newInput, QtConversionType newConversionType, const char *=NULL)
constructor getting operand and format conversion type
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
void setConversionTypeByName(std::string formatName)
set the format conversion type by name
Definition: qtconversion.hh:59
virtual bool equalMeaning(QtNode *node)
test if the two nodes have an equal meaning in a subtree
Definition: qtconversion.hh:63
Definition: qtconversion.hh:50
Definition: qtoperation.hh:57
Definition: qtconversion.hh:64
Definition: qtconversion.hh:66
Definition: qtnode.hh:190