IODA Bundle
Block.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, Oct 2015
12 
13 #ifndef Block_H
14 #define Block_H
15 
16 #include "eckit/io/Offset.h"
17 #include "eckit/io/Length.h"
18 #include "eckit/io/MultiHandle.h"
19 #include "eckit/filesystem/PathName.h"
20 
21 #include "odc/tools/Tool.h"
22 
23 #include <vector>
24 
25 namespace odc {
26 
27 typedef unsigned long long ullong;
28 
29 class Block {
30 public:
32  :
33  fileName (),
34  start (),
35  end (),
36  firstRow (),
37  lastRow ()
38  {}
39 
40  Block(const eckit::PathName& fileName,
41  const eckit::Offset& start,
42  const eckit::Offset& end,
43  const ullong firstRow,
44  const ullong lastRow)
45  :
47  start (start),
48  end (end),
51  {}
52 
53  Block (const Block& other)
54  :
55  fileName (other.fileName),
56  start (other.start),
57  end (other.end),
58  firstRow (other.firstRow),
59  lastRow (other.lastRow)
60  {}
61 
62  Block& operator=(const Block& other)
63  {
64  fileName = other.fileName;
65  start = other.start;
66  end = other.end;
67  firstRow = other.firstRow;
68  lastRow = other.lastRow;
69  return *this;
70  }
71 
72  eckit::PathName fileName;
73  eckit::Offset start;
74  eckit::Offset end;
77 
78  std::string str() const;
79 };
80 
81 std::ostream& operator<<(std::ostream&, const Block&);
82 
83 } // namespace odc
84 
85 #endif
eckit::Offset start
Definition: Block.h:73
eckit::PathName fileName
Definition: Block.h:72
Block(const eckit::PathName &fileName, const eckit::Offset &start, const eckit::Offset &end, const ullong firstRow, const ullong lastRow)
Definition: Block.h:40
Block & operator=(const Block &other)
Definition: Block.h:62
std::string str() const
Definition: Block.cc:27
ullong firstRow
Definition: Block.h:75
Block(const Block &other)
Definition: Block.h:53
eckit::Offset end
Definition: Block.h:74
ullong lastRow
Definition: Block.h:76
Block()
Definition: Block.h:31
Definition: ColumnInfo.h:23
unsigned long long ullong
Definition: Block.h:27
ostream & operator<<(ostream &o, const Block &b)
Definition: Block.cc:34