rasdaman complete source
mddcolliter.hh
Go to the documentation of this file.
1 #ifndef _MDDCOLLITER_HH_
2 #define _MDDCOLLITER_HH_
3 
4 class MDDCollIter;
5 class MDDColl;
6 class MDDObj;
7 
8 #include "mddobj.hh"
9 #include "relmddif/mddid.hh" // from mddif interface module
10 
11 #include <stdlib.h>
12 #include <iostream>
13 /*
14 * This file is part of rasdaman community.
15 *
16 * Rasdaman community is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * Rasdaman community is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
28 *
29 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
30 rasdaman GmbH.
31 *
32 * For more information please see <http://www.rasdaman.org>
33 * or contact Peter Baumann via <baumann@rasdaman.com>.
34 /
49 //@ManMemo: Module: {\bf cachetamgr}
50 /*@Doc:
51  A MDDCollIter represents an iterator for a persistent MDD collection.
52  If a collection is changed (elements are removed or added to/from the
53  collection) between creation of an iterator for it and the execution of
54  other operations on the iterator, the behavior of the istent Iterator
55  is undefined.
56  The {\tt MDDColl::createIterator()} for the object to be scanned should
57  be used to create a new iterator object.
58 */
59 
60 class MDDCollIter
61 {
62 public:
63  void printStatus(unsigned int level = 0, ostream& stream = cout) const;
64 
65  void reset();
66 
67  bool notDone() const;
68 
69  void advance();
70 
71  MDDObj* getElement() const;
72 
73  ~MDDCollIter();
74 
75 protected:
76 
77  friend class MDDColl;
78 
79  MDDCollIter(MDDColl* targetColl);
85 private:
86 
87  // Corresponding iterator in the base DBMS.
88  DBMDDObjIdIter* dbIter;
89 
90  // dbColl has to be kept because of error control.
91  DBMDDSetId dbColl;
92 
93  // Collection to iterate.
94  MDDColl* persColl;
95 };
96 
97 #endif
Definition: dbobjectiditerator.hh:30
Definition: dbobject.hh:29