Elements 6.1.2
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
ElementsExamples/src/program/AnotherSimpleProgram.cpp

This is an example of how to use the SimpleProgram class.

#include <iostream>
#include "ElementsKernel/Exception.h" // For Exception
#include "ElementsKernel/Exit.h" // For ExitCode
namespace Elements {
namespace Examples {
class AnotherSimpleProgram : public SimpleProgram {
public:
void defineOptions() override {}
ExitCode main() override {
std::cout << "Program name: " << getProgramName() << std::endl;
std::cout << "Program path: " << getProgramPath() << std::endl;
throw Exception("This is an example exception.");
return ExitCode::OK;
}
};
} // namespace Examples
} // namespace Elements
defines the base Elements exception class
define a list of standard exit codes for executables
ExitCode main() override
The "main" method.
Elements::ExitCode ExitCode
Definition: Program.h:67
T endl(T... args)
#define MAIN(ELEMENTS_PROGRAM)
Definition: SimpleProgram.h:79
@ OK
Everything is OK.