IODA Bundle
Partitions.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 /// @author Piotr Kuchta, ECMWF, November 2015
12 
13 #ifndef odc_Partitions_H
14 #define odc_Partitions_H
15 
16 #include "odc/Block.h"
17 #include "odc/Partition.h"
18 
19 #include <vector>
20 
21 namespace eckit { class PathName; }
22 
23 namespace odc {
24 
25 typedef std::vector<Partition> PartitionsBase;
26 
27 class Partitions : public PartitionsBase {
28 public:
29  // Write data to files fileNamePrefix.pool_[i]
30  std::vector<eckit::PathName> write(const eckit::PathName& fileNamePrefix) const;
31 
32  void addReport(const eckit::PathName& fileName, ullong blockStart, ullong blockLength, ullong seqno, ullong nRows, ullong rowsPerPartition);
33 
34  // Write partiions info to a text file
35  void save(const eckit::PathName&);
36 
37  std::string str() const;
38 
39 private:
40  friend std::ostream& operator<< (std::ostream&, const Partitions&);
41 };
42 
43 } // namespace odc
44 
45 #endif
std::vector< eckit::PathName > write(const eckit::PathName &fileNamePrefix) const
Definition: Partitions.cc:37
void save(const eckit::PathName &)
Definition: Partitions.cc:58
std::string str() const
Definition: Partitions.cc:69
void addReport(const eckit::PathName &fileName, ullong blockStart, ullong blockLength, ullong seqno, ullong nRows, ullong rowsPerPartition)
Definition: Partitions.cc:76
friend std::ostream & operator<<(std::ostream &, const Partitions &)
Definition: Partitions.cc:29
Definition: ColumnInfo.h:23
std::vector< Partition > PartitionsBase
Definition: Partitions.h:25
unsigned long long ullong
Definition: Block.h:27