Elements  5.12.0
A C++ base framework for the Euclid Software.
Program.h
Go to the documentation of this file.
1 
27 #ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_PROGRAM_H_
28 #define ELEMENTSKERNEL_ELEMENTSKERNEL_PROGRAM_H_
29 
30 #include <string> // for string
31 #include <utility> // for pair
32 #include <map> // for map
33 #include <memory> // for unique_ptr
34 
35 #include <boost/program_options.hpp>
36 
37 #include "ElementsKernel/Export.h" // ELEMENTS_API
38 #include "ElementsKernel/Exit.h" // for ExitCode
39 #include "ElementsKernel/Logging.h" // for Logging
40 
41 namespace Elements {
42 
53 
54 public:
55 
56  // backwards compatible type aliases
57  using options_description = boost::program_options::options_description;
58  using positional_options_description = boost::program_options::positional_options_description;
59  using variable_value = boost::program_options::variable_value;
60  using variables_map = boost::program_options::variables_map;
61 
62  // camel case type aliases
67 
70 
74  Program() = default;
75 
79  virtual ~Program();
80 
90  virtual OptionsDescription defineSpecificProgramOptions();
91 
101  virtual std::pair<OptionsDescription, PositionalOptionsDescription> defineProgramArguments();
102 
117 
118 };
119 
125 } // namespace Elements
126 
127 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_PROGRAM_H_
128 
define a list of standard exit codes for executables
defines the macros to be used for explicit export of the symbols
Logging facility.
Logging API of the Elements framework.
Definition: Logging.h:93
Abstract class for all Elements programs.
Definition: Program.h:52
options_description OptionsDescription
Definition: Program.h:63
boost::program_options::options_description options_description
Definition: Program.h:57
boost::program_options::positional_options_description positional_options_description
Definition: Program.h:58
boost::program_options::variables_map variables_map
Definition: Program.h:60
variable_value VariableValue
Definition: Program.h:65
positional_options_description PositionalOptionsDescription
Definition: Program.h:64
virtual ExitCode mainMethod(std::map< std::string, VariableValue > &args)=0
This is the "main" method of all Elements programs.
Program()=default
Constructor.
virtual ~Program()
Destructor.
variables_map VariablesMap
Definition: Program.h:66
boost::program_options::variable_value variable_value
Definition: Program.h:59
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:98
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74