IODA Bundle
ODA2RequestTool.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 #ifndef ODA2RequestTool_H
12 #define ODA2RequestTool_H
13 
14 #include "odc/tools/Tool.h"
15 
16 namespace odc {
17 namespace tool {
18 
19 class ODA2RequestTool : public Tool {
20  typedef std::string Value;
21  typedef std::set<Value> Values;
22 
23 public:
25  ODA2RequestTool(int argc, char **argv);
27 
28  static void help(std::ostream &o);
29  static void usage(const std::string& name, std::ostream &o);
30 
31  virtual void run();
32 
33  void readConfig();
34  void readConfig(const eckit::PathName&);
35  void parseConfig(const std::string&);
36 
37  std::string generateMarsRequest(const eckit::PathName& inputFile, bool fast = false);
38 
39 protected:
40  std::vector<Values>& values() { return values_; }
41 
42  void gatherStats(const eckit::PathName& inputFile);
43  std::string gatherStatsFast(const eckit::PathName& inputFile);
44 
45  eckit::PathName config();
46 
47 private:
48  std::map<std::string, std::string> columnName2requestKey_;
49  std::vector<Values> values_;
50 };
51 
52 } // namespace tool
53 } // namespace odc
54 
55 #endif
56 
std::vector< Values > & values()
void gatherStats(const eckit::PathName &inputFile)
std::string gatherStatsFast(const eckit::PathName &inputFile)
void readConfig(const eckit::PathName &)
void parseConfig(const std::string &)
std::vector< Values > values_
static void usage(const std::string &name, std::ostream &o)
std::set< Value > Values
static void help(std::ostream &o)
std::map< std::string, std::string > columnName2requestKey_
std::string generateMarsRequest(const eckit::PathName &inputFile, bool fast=false)
std::string name()
Definition: Tool.h:34
Definition: ColumnInfo.h:23