rasdaman complete source
qtdata.hh
Go to the documentation of this file.
1 #ifndef _QTDATA_
2 #define _QTDATA_
3 
4 #include <iostream>
5 
6 #include "qlparser/parseinfo.hh"
7 #include "raslib/rminit.hh"
8 
9 #ifndef CPPSTDLIB
10 #include <ospace/string.h> // STL<ToolKit>
11 #else
12 #include <string>
13 #endif
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 //@Man: TypeEnum
45 //@Type: typedef
46 //@Memo: Module: {\bf qlparser}.
47 
49 {
60  QT_COMPLEXTYPE1, // with float members
61  QT_COMPLEXTYPE2, // with double
69 };
70 
71 
72 
73 
74 //@ManMemo: Module: {\bf qlparser}
75 
76 /*@Doc:
77 
78 This class is superclass for the classes representing a
79 specific data type handled by the query tree.
80 
81 */
82 
83 class QtData
84 {
85 public:
86  // construktor
87  QtData();
88 
89  // constructor
90  QtData( const std::string name );
91 
93  QtData( const QtData &obj );
94 
96  virtual ~QtData();
97 
99  const QtData& operator=( const QtData& obj );
100 
102  {
105  };
106 
108  virtual QtDataType getDataType() const = 0;
128  virtual char* getTypeStructure() const = 0;
134  virtual bool isScalarData() const;
136 
138  virtual bool equal( const QtData* obj ) const = 0;
139 
141  virtual std::string getSpelling() const = 0;
142 
143  //@Man: Read/Write methods:
145 
148  inline std::string const getIteratorName() const;
150  inline void setIteratorName( const std::string & iteratorNameNew );
152  inline QtLifetime const getLifetime() const;
154  inline void setLifetime( QtLifetime flag );
156  inline unsigned int getRefNo() const;
158  inline void incRef();
160  inline int deleteRef();
165  inline ParseInfo getParseInfo();
168  inline void setParseInfo( const ParseInfo &info );
169 
171 
172 
174  virtual void printStatus( std::ostream& stream = std::cout ) const;
175 
176 protected:
179 
180 private:
182  inline unsigned int decRef();
183 
185  std::string iteratorName;
186 
188  QtLifetime persistent;
194  unsigned int referenceCounter;
196 };
197 
198 #include "qlparser/qtdata.icc"
199 
200 #endif
201 
unsigned int getRefNo() const
return number of references to the self object
Definition: qtdata.hh:68
Definition: qtdata.hh:104
Definition: qtdata.hh:103
Definition: parseinfo.hh:51
Definition: qtdata.hh:83
void incRef()
increases the reference counter by one
Definition: qtdata.hh:63
const QtData & operator=(const QtData &obj)
assignement operator
QtLifetime
Definition: qtdata.hh:101
virtual bool equal(const QtData *obj) const =0
compares data content
Definition: qtdata.hh:57
Definition: qtdata.hh:59
Definition: qtdata.hh:58
virtual bool isScalarData() const
determines, if the data is of type scalar
virtual char * getTypeStructure() const =0
returns a null-terminated string describing the type structure
void setLifetime(QtLifetime flag)
ParseInfo * parseInfo
pointer to an optional parser info
Definition: qtdata.hh:178
Definition: qtdata.hh:51
virtual QtDataType getDataType() const =0
returns type of data represented by the QtData object
QtLifetime const getLifetime() const
Definition: qtdata.hh:62
void setIteratorName(const std::string &iteratorNameNew)
Definition: qtdata.hh:66
Definition: qtdata.hh:52
Definition: qtdata.hh:54
ParseInfo getParseInfo()
virtual ~QtData()
destructor
void setParseInfo(const ParseInfo &info)
virtual void printStatus(std::ostream &stream=std::cout) const
print status of the object to the specified stream
Definition: qtdata.hh:65
Definition: qtdata.hh:67
QtDataType
Definition: qtdata.hh:48
std::string const getIteratorName() const
get the iterator name
Definition: qtdata.hh:60
Definition: qtdata.hh:50
Definition: qtdata.hh:53
virtual std::string getSpelling() const =0
returns content dependent string representation
Definition: qtdata.hh:55
Definition: qtdata.hh:61
Definition: qtdata.hh:64
Definition: qtdata.hh:56
int deleteRef()
deletes one reference and the object if it was the last one