Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
AnotherSimpleProgram.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
28namespace Elements {
29namespace Examples {
30
40
41public:
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
ExitCode main() override
The "main" method.
Example of an Elements program.
Elements base exception class.
Definition: Exception.h:47
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.