rasdaman complete source
qtiterator.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 #ifndef _QTITERATOR_
24 #define _QTITERATOR_
25 
26 #include "qlparser/qtoncstream.hh"
27 
28 #include <vector>
29 
30 /*************************************************************
31  *
32  *
33  * COMMENTS:
34  *
35  ************************************************************/
36 
37 //@ManMemo: Module: {\bf qlparser}
38 
39 /*@Doc:
40 
41 It is super class for every class capable of iterating over collections of MDD.
42 It has a list of inputs of type QtONCStream, so every instance of type
43 QtONCStream or of a subtype of it can serve as an input stream for a QtIterator
44 object. The input streams can be combined differently, as cross product of the
45 inputs in class QtSelectionIterator or as simple tupels in the order they occure
46 in the input streams in class QtOperationIterator.
47 
48 */
49 
50 class QtIterator : public QtONCStream
51 {
52 public:
54  typedef std::vector<QtONCStream*> QtONCStreamList;
55 
57  QtIterator();
58 
60  QtIterator( QtNode* node );
61 
63  virtual ~QtIterator();
64 
66  virtual QtNodeList* getChilds( QtChildType flag );
67 
69  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
70 
72  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
73 
74  //@Man: Operations of the ONC protocol
76  virtual void open();
79  virtual void close();
81  virtual void reset();
83 
84  //@Man: Read/Write methods:
86  inline void setStreamInputs( QtONCStreamList* inputs );
88 
90  QtONCStreamList* getStreamInputs();
92  void setStreamInput( QtONCStream* oldInput, QtONCStream* newInput );
94  //inline virtual void setParents();
96 
98  //virtual void preOptimize();
103  void getInputTypeTuple( QtTypeTuple& typeTuple );
105 
106 protected:
108  QtONCStreamList* inputs;
109 
110 private:
112  static const QtNodeType nodeType;
113 };
114 
115 #include "qlparser/qtiterator.icc"
116 
117 #endif
118 
std::list< QtNode * > QtNodeList
list of QtNode pointers
Definition: qtnode.hh:91
Definition: qtiterator.hh:50
Definition: qtnode.hh:463
QtONCStreamList * inputs
list of input streams
Definition: qtiterator.hh:108
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
QtChildType
Definition: qtnode.hh:186
QtNodeType
Definition: qtnode.hh:93
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
Definition: qtoncstream.hh:54
virtual void open()
virtual ~QtIterator()
destructor
QtIterator()
default constructor
void getInputTypeTuple(QtTypeTuple &typeTuple)
pre optimization
std::vector< QtONCStream * > QtONCStreamList
list of QtONCStream objects
Definition: qtiterator.hh:54
Definition: qtnode.hh:73
void setStreamInput(QtONCStream *oldInput, QtONCStream *newInput)
exchange the stream input { oldInput} with { newInput}
virtual QtNodeList * getChilds(QtChildType flag)
return childs of the node
void setStreamInputs(QtONCStreamList *inputs)
virtual void reset()
QtONCStreamList * getStreamInputs()
Returns inputs.
Definition: qtnode.hh:190
virtual void close()