Debian Codegraph @

src/atlas/util/GridPointsJSONWriter.h

raw
1 /*
2 * (C) Copyright 2023 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
8 * nor does it submit to any jurisdiction.
9 */
10 #pragma once
11
12 #include <iosfwd>
13
14 #include "eckit/config/Parametrisation.h"
15
16 #include "atlas/grid.h"
17
18 namespace atlas {
19 namespace util {
20
21 //------------------------------------------------------------------------------
22
23 class GridPointsJSONWriter {
24 public:
25 GridPointsJSONWriter(Grid grid, const eckit::Parametrisation& args);
26
27 void write(std::ostream& out, eckit::Channel& info) const;
28
29 void write(std::ostream& out, std::ostream* info = nullptr) const;
30
31 private:
32 Grid grid_;
33 grid::Distribution distribution_;
34 int precision_;
35 int verbose_;
36 int nb_partitions_;
37 int partition_;
38 bool pretty_;
39 std::string field_;
40 std::vector<long> points_;
41 long points_base_;
42 long field_base_;
43 };
44
45 //------------------------------------------------------------------------------
46
47 } // namespace util
48 } // namespace atlas