Elements  5.8
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SimpleProgram.h
Go to the documentation of this file.
1 
28 #ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_SIMPLEPROGRAM_H_
29 #define ELEMENTSKERNEL_ELEMENTSKERNEL_SIMPLEPROGRAM_H_
30 
31 #include <boost/filesystem/path.hpp>
32 
33 #include "ElementsKernel/Export.h"
34 #include "ElementsKernel/Main.h"
35 
36 namespace Elements {
37 
38 // Forward declaration. We don't need the definition right now.
39 enum class ExitCode;
40 
42 
43 public:
44 
45  ELEMENTS_API ExitCode run(int argc, char** argv) noexcept;
46  ELEMENTS_API const boost::filesystem::path& getProgramPath() const;
47  ELEMENTS_API const boost::filesystem::path& getProgramName() const;
48 
49 
50 protected:
51 
52  SimpleProgram() = default;
53  virtual ~SimpleProgram();
54 
55  virtual ExitCode main() = 0;
56  virtual void defineOptions() = 0;
57 
58 private:
59 
60  void setup(int argc, char** argv);
61 
62 private:
63 
66 
67 };
68 
69 } // namespace Elements
70 
71 
72 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_SIMPLEPROGRAM_H_
73 
boost::filesystem::path m_program_name
Definition: SimpleProgram.h:64
defines the macros to be used for explicit export of the symbols
Definition of the top macro to create an Elements program.
boost::filesystem::path path
Definition: DataSyncUtils.h:33
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
boost::filesystem::path m_program_path
Definition: SimpleProgram.h:65