IODA Bundle
MDUpdatingIterator.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2012 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 ///
12 /// \file MDUpdatingIterator.h
13 ///
14 /// @author Piotr Kuchta, June 2009
15 
16 #ifndef MDUpdatingIterator_H
17 #define MDUpdatingIterator_H
18 
19 namespace odc {
20 
21 class MetaData;
22 
23 template <typename T>
25 {
26 public:
27  MDUpdatingIterator (T& inputIterator, const T& end, const std::vector<std::string>& columns, const std::vector<std::string>& types);
28  MDUpdatingIterator (const T& end);
30 
31  bool isNewDataset();
32  double* data() { return data_; }
33 
34  MetaData& columns(); // { return ii_->columns(); }
35 
36  MDUpdatingIterator& operator++() { next(); return *this; }
37 
38  bool operator!=(const MDUpdatingIterator& o) { ASSERT(&o == 0); return ii_ != end_; }
39 
40 //protected:
41  bool next();
42 
43 private:
44 // No copy allowed.
47 
48  void update();
49 
50  // Input iterator.
51  T ii_;
52  const T& end_;
53 
54  const std::vector<std::string> columns_;
55  std::vector<size_t> columnIndices_;
56  const std::vector<std::string> types_;
57  std::vector<BitfieldDef> bitfieldDefs_;
58 
59  MetaData md_;
60 
61  double *data_;
62 public:
63  int refCount_;
64  bool noMore_;
65 };
66 
67 } // namespace odc
68 
70 
71 #endif
const std::vector< std::string > columns_
std::vector< BitfieldDef > bitfieldDefs_
std::vector< size_t > columnIndices_
const std::vector< std::string > types_
MDUpdatingIterator & operator++()
MDUpdatingIterator & operator=(const MDUpdatingIterator &)
bool operator!=(const MDUpdatingIterator &o)
MDUpdatingIterator(const MDUpdatingIterator &)
MDUpdatingIterator(T &inputIterator, const T &end, const std::vector< std::string > &columns, const std::vector< std::string > &types)
Definition: ColumnInfo.h:23