NAME
A function of omni::application
OVERLOADS
omni::application::run
A function of omni::application
#include <omni/application.hpp>int omni::application::run()OVERLOADS
int omni::application::run(const int& argc, const char** argv)
int omni::application::run(const int& argc, const wchar_t** argv)
int omni::application::run(const omni::sync::thread_start& start_func)
int omni::application::run(const omni::sync::thread_start& start_func, bool exit_with_work_thread)
int omni::application::run(const omni::sync::thread_start& start_func, bool exit_with_work_thread, bool kill_worker_on_signal)
inline int omni::application::run(const omni::sync::thread_start& start_func, const omni::application::run_type& run_type)
int omni::application::run(const int& argc, const char** argv, const omni::sync::thread_start& start_func, bool exit_with_work_thread)
int omni::application::run(const int& argc, const char** argv, const omni::sync::thread_start& start_func, bool exit_with_work_thread, bool kill_worker_on_signal)
inline int omni::application::run(const int& argc, const char** argv, const omni::sync::thread_start& start_func, const omni::application::run_type& run_type)
int omni::application::run(const int& argc, const wchar_t** argv, const omni::sync::thread_start& start_func, bool exit_with_work_thread)
int omni::application::run(const int& argc, const wchar_t** argv, const omni::sync::thread_start& start_func, bool exit_with_work_thread, bool kill_worker_on_signal)
inline int omni::application::run(const int& argc, const wchar_t** argv, const omni::sync::thread_start& start_func, const omni::application::run_type& run_type)
int omni::application::run(const omni::sync::parameterized_thread_start& start_func)
int omni::application::run(const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs)
int omni::application::run(const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, bool exit_with_work_thread)
int omni::application::run(const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, bool exit_with_work_thread, bool kill_worker_on_signal)
inline int omni::application::run(const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, const omni::application::run_type& run_type)
int omni::application::run(const int& argc, const char** argv, const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, bool exit_with_work_thread)
int omni::application::run(const int& argc, const char** argv, const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, bool exit_with_work_thread, bool kill_worker_on_signal)
inline int omni::application::run(const int& argc, const char** argv, const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, const omni::application::run_type& run_type)
int omni::application::run(const int& argc, const wchar_t** argv, const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, bool exit_with_work_thread)
int omni::application::run(const int& argc, const wchar_t** argv, const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, bool exit_with_work_thread, bool kill_worker_on_signal)
inline int omni::application::run(const int& argc, const wchar_t** argv, const omni::sync::parameterized_thread_start& start_func, omni::generic_ptr targs, const omni::application::run_type& run_type)
DESCRIPTION
This function is part of the application framework that allows you to hook in to certain system level functionality, as well as have access to other long running application contexts. This function will pause the main application until one of either
top
This function is part of the application framework that allows you to hook in to certain system level functionality, as well as have access to other long running application contexts. This function will pause the main application until one of either
omni::application::exit or omni::application::stop are called, or an exception is thrown and not caught. Along with the other variants of the run function, you can simplify argument and main program loop handling for global and multi-threaded environments in a more simplified way.
top
ERRORS
Since run need only be called once, if it is called again after being called at program start, it will throw an
top
Since run need only be called once, if it is called again after being called at program start, it will throw an
omni::exceptions::invalid_application_state as calling run more than once will cause the system to get into an undefined state.
top
CONSIDERATIONS
You cannot utilize the signal or application handlers unless this or one of its variants are called in the main function of your code or library initialization routine.
top
You cannot utilize the signal or application handlers unless this or one of its variants are called in the main function of your code or library initialization routine.
top
NOTES
If
top
If
OMNI_NO_BASE_SETLOCALE is not defined, then the setlocale function is called with a category LC_ALL and an empty locale. If you wish to specify which category and locale to utilize, you can define OMNI_BASE_LOCALE_CATEGORY and OMNI_BASE_LOCALE
top
EXAMPLE
Visit the examples page for more.
top
#include <omnilib> void app_exit() { std::cout << "Application exiting" << std::endl; } int main(int argc, const char* argv[]) { omni::application::exit_handler::attach(&app_exit); std::cout << "Waiting for CTRL+C" << std::endl; return omni::application::run(); }
top