Elements  6.0.1
A C++ base framework for the Euclid Software.
AnotherSimpleProgramExample.cpp
Go to the documentation of this file.
1 
22 #include <iostream>
23 
24 #include "ElementsKernel/Exception.h" // For Exception
25 #include "ElementsKernel/Exit.h" // For ExitCode
27 
28 namespace Elements {
29 namespace Examples {
30 
40 
41 public:
42  void defineOptions() override {}
43 
55  ExitCode main() override {
56 
57  std::cout << "Program name: " << getProgramName() << std::endl;
58  std::cout << "Program path: " << getProgramPath() << std::endl;
59 
60  throw Exception("This is an example exception.");
61 
62  return ExitCode::OK;
63  }
64 };
65 
66 } // namespace Examples
67 } // namespace Elements
68 
defines the base Elements exception class
define a list of standard exit codes for executables
Elements base exception class.
Definition: Exception.h:47
ELEMENTS_API const Path::Item & getProgramPath() const
ELEMENTS_API const Path::Item & getProgramName() const
T endl(T... args)
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
#define MAIN(ELEMENTS_PROGRAM)
Definition: SimpleProgram.h:79
@ OK
Everything is OK.