Elements
6.2
A C++ base framework for the Euclid Software.
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
#include "
ElementsKernel/SimpleProgram.h
"
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
MAIN
(
Elements::Examples::AnotherSimpleProgram
)
Elements::ExitCode::OK
@ OK
Everything is OK.
Elements::Program::ExitCode
Elements::ExitCode ExitCode
Definition:
Program.h:67
Elements::Examples::AnotherSimpleProgram::main
ExitCode main() override
The "main" method.
Definition:
AnotherSimpleProgram.cpp:55
SimpleProgram.h
Exit.h
define a list of standard exit codes for executables
Exception.h
defines the base Elements exception class
std::cout
std::endl
T endl(T... args)
Elements::Examples::AnotherSimpleProgram
Example of an Elements program.
Definition:
AnotherSimpleProgram.cpp:39
MAIN
#define MAIN(ELEMENTS_PROGRAM)
Definition:
SimpleProgram.h:79
Elements::Examples::AnotherSimpleProgram::defineOptions
void defineOptions() override
Definition:
AnotherSimpleProgram.cpp:42
Elements
Definition:
callBackExample.h:35
Generated by
1.8.17