Elements  6.2
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 <map> // for map
31 #include <memory> // for unique_ptr
32 #include <string> // for string
33 #include <utility> // for pair
34 
35 #include <boost/program_options.hpp>
36 
37 #include "ElementsKernel/Exit.h" // for ExitCode
38 #include "ElementsKernel/Export.h" // ELEMENTS_API
39 #include "ElementsKernel/Logging.h" // for Logging
40 
41 namespace Elements {
42 
53 
54 public:
55  // backwards compatible type aliases
56  using options_description = boost::program_options::options_description;
57  using positional_options_description = boost::program_options::positional_options_description;
58  using variable_value = boost::program_options::variable_value;
59  using variables_map = boost::program_options::variables_map;
60 
61  // camel case type aliases
66 
69 
73  Program() = default;
74 
78  virtual ~Program();
79 
89  virtual OptionsDescription defineSpecificProgramOptions();
90 
100  virtual std::pair<OptionsDescription, PositionalOptionsDescription> defineProgramArguments();
101 
115  virtual ExitCode mainMethod(std::map<std::string, VariableValue>& args) = 0;
116 };
117 
123 } // namespace Elements
124 
125 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_PROGRAM_H_
126 
Export.h
defines the macros to be used for explicit export of the symbols
Elements::Program::variable_value
boost::program_options::variable_value variable_value
Definition: Program.h:58
std::pair
Elements::Logging
Logging API of the Elements framework.
Definition: Logging.h:93
Elements::Program::VariablesMap
variables_map VariablesMap
Definition: Program.h:65
Elements::Program::OptionsDescription
options_description OptionsDescription
Definition: Program.h:62
Exit.h
define a list of standard exit codes for executables
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Elements::Program::PositionalOptionsDescription
positional_options_description PositionalOptionsDescription
Definition: Program.h:63
ELEMENTS_API
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::Program::options_description
boost::program_options::options_description options_description
Definition: Program.h:56
Elements::Program::VariableValue
variable_value VariableValue
Definition: Program.h:64
Elements::Program::positional_options_description
boost::program_options::positional_options_description positional_options_description
Definition: Program.h:57
std::map
STL class.
Elements::Program
Abstract class for all Elements programs.
Definition: Program.h:52
Logging.h
Logging facility.
Elements::Program::variables_map
boost::program_options::variables_map variables_map
Definition: Program.h:59
Elements
Definition: callBackExample.h:35