rasdaman complete source
qtmddaccess.hh
Go to the documentation of this file.
1 #ifndef _QTMDDACCESS_
2 #define _QTMDDACCESS_
3 
5 
6 #ifndef CPPSTDLIB
7 #include <ospace/string.h> // STL<ToolKit>
8 #else
9 #include <string>
10 #endif
11 
12 // forward declarations
13 class MDDColl;
14 class MDDCollIter;
15 
16 /*
17 * This file is part of rasdaman community.
18 *
19 * Rasdaman community is free software: you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation, either version 3 of the License, or
22 * (at your option) any later version.
23 *
24 * Rasdaman community is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
28 *
29 * You should have received a copy of the GNU General Public License
30 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
31 *
32 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
33 rasdaman GmbH.
34 *
35 * For more information please see <http://www.rasdaman.org>
36 * or contact Peter Baumann via <baumann@rasdaman.com>.
37 */
38 /*************************************************************
39  *
40  *
41  * COMMENTS:
42  *
43  ************************************************************/
44 
45 //@ManMemo: Module: {\bf qlparser}
46 
47 /*@Doc:
48 
49 This class encapsulates a MDDCollection. It gives access to the elements
50 through the ONC protocol. The list returned by next() consists of just one
51 element.
52 
53 */
54 
55 class QtMDDAccess : public QtONCStream
56 {
57 public:
59  QtMDDAccess( const std::string& collectionName );
60 
62  QtMDDAccess( const std::string& collectionName, const std::string& iteratorName );
63 
65  virtual ~QtMDDAccess();
66 
67  //@Man: Operations of the ONC protocol
69  void open();
72  QtDataList* next();
74  void close();
76  void reset();
78 
80  virtual void printTree( int tab, std::ostream& s = std::cout, QtChildType mode = QT_ALL_NODES );
81 
83  virtual void printAlgebraicExpression( std::ostream& s = std::cout );
84 
86  inline virtual const QtNodeType getNodeType() const;
87 
89  inline MDDColl* getMDDColl();
90 
92  virtual const QtTypeTuple& checkType();
93 
94 private:
96  std::string collectionName;
97 
99  std::string iteratorName;
100 
102  MDDColl* mddColl;
103 
105  MDDCollIter* mddIter;
106 
108  static const QtNodeType nodeType;
109 };
110 
111 #include "qlparser/qtmddaccess.icc"
112 
113 #endif
114 
MDDColl * getMDDColl()
method for retrieving the current MDD collection
std::vector< QtData * > QtDataList
list of QtData pointers
Definition: qtnode.hh:77
virtual void printAlgebraicExpression(std::ostream &s=std::cout)
prints the algebraic expression
QtMDDAccess(const std::string &collectionName)
constructor getting the collection name if no iterator name is specified
Definition: qtnode.hh:463
void close()
QtChildType
Definition: qtnode.hh:186
void reset()
QtNodeType
Definition: qtnode.hh:93
Definition: qtoncstream.hh:54
virtual void printTree(int tab, std::ostream &s=std::cout, QtChildType mode=QT_ALL_NODES)
prints the tree
virtual const QtNodeType getNodeType() const
method for identification of nodes
virtual const QtTypeTuple & checkType()
type checking
Definition: qtnode.hh:190
Definition: qtmddaccess.hh:55
QtDataList * next()
virtual ~QtMDDAccess()
destructor