Orocos Real-Time Toolkit  2.8.3
Macros | Functions
main.h File Reference

The prototype of the application's ORO_main. More...

#include "startstop.h"
#include "../Logger.hpp"

Go to the source code of this file.

Macros

#define ORO_main
 Declare the function 'int ORO_main(int argc, char **argv)' instead of 'int main(int argc, char **argv)' such that the Real-Time Toolkit can setup the OS environment, prior to executing user code. More...
 

Functions

int ORO_main_impl (int, char **)
 Forward declare this wrapper around the user code. More...
 

Detailed Description

The prototype of the application's ORO_main.

Definition in file main.h.

Macro Definition Documentation

#define ORO_main
Value:
main( int argc, char **argv) { \
int res = -1; \
std::string location(argv[0]); location += "::main()"; \
__os_init(argc, argv); { \
RTT::Logger::In in(location.c_str()); \
if ( __os_checkException(argc,argv) ) { \
try { \
res = ORO_main_impl(argc, argv); \
} catch( std::exception& arg ) \
{ \
__os_printException(argv[0], arg); \
} catch( ... ) \
{ \
__os_printFailure(argv[0]); \
} \
} else { \
res = ORO_main_impl(argc, argv); \
} \
} __os_exit(); \
return res; \
} \
void __os_printException(const char *prog, std::exception &arg)
Internal: Inform the user that a failure occured.
Definition: startstop.cpp:135
int __os_checkException(int &argc, char **argv)
Internal: Check if the user requests disabling exception catching at run-time.
Definition: startstop.cpp:146
int __os_init(int argc, char **argv)
Call this function from within main() before using the RTT services.
Definition: startstop.cpp:75
int ORO_main_impl(int, char **)
Forward declare this wrapper around the user code.
void __os_exit(void)
Call this function from within main() after using the RTT services, just before returning.
Definition: startstop.cpp:162
void __os_printFailure(const char *prog)
Internal: Inform the user that a failure occured.
Definition: startstop.cpp:116

Declare the function 'int ORO_main(int argc, char **argv)' instead of 'int main(int argc, char **argv)' such that the Real-Time Toolkit can setup the OS environment, prior to executing user code.

Using ORO_main is optional, but in some RTOS'es, you'll be required to call __os_init() and __os_exit() instead when not using ORO_main.

See also
__os_init(), __os_exit()

Definition at line 65 of file main.h.

Function Documentation

int ORO_main_impl ( int  ,
char **   
)

Forward declare this wrapper around the user code.

See also
ORO_main