IODA Bundle
Tool.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 /// \file Tool.h
12 ///
13 /// @author Piotr Kuchta, ECMWF, Feb 2009
14 
15 #ifndef Tool_H
16 #define Tool_H
17 
18 #include "odc/CommandLineParser.h"
19 #include "odc/StringTool.h"
20 
21 namespace eckit { class PathName; }
22 class Application;
23 
24 namespace odc {
25 namespace tool {
26 
27 class Tool : public StringTool, public CommandLineParser {
28 public:
29 
30  virtual void run() = 0;
31 
32  virtual ~Tool();
33 
34  std::string name() { return name_; }
35  void name(const std::string& s) { name_ = s; }
36 
37  static void registerTools();
38 
39 protected:
40 
41  Tool(int argc, char **argv);
42  Tool(const CommandLineParser&);
43 
44 private:
45  std::string name_;
46 };
47 
48 
49 template <typename T> struct ExperimentalTool { enum { experimental = false }; };
50 
51 } // namespace tool
52 } // namespace odc
53 
54 #endif
55 
virtual void run()=0
static void registerTools()
Definition: Tool.cc:48
std::string name_
Definition: Tool.h:45
void name(const std::string &s)
Definition: Tool.h:35
std::string name()
Definition: Tool.h:34
Tool(int argc, char **argv)
Definition: Tool.cc:40
virtual ~Tool()
Definition: Tool.cc:38
Definition: ColumnInfo.h:23