#include <apprunner.h>
Public Member Functions | |
AppRunner (nap::Core &core) | |
virtual | ~AppRunner () |
AppRunner (AppRunner &)=delete | |
AppRunner & | operator= (const AppRunner &)=delete |
AppRunner (AppRunner &&)=delete | |
AppRunner & | operator= (AppRunner &&)=delete |
bool | start (utility::ErrorState &error) |
void | stop () |
APP & | getApp () |
HANDLER & | getHandler () |
int | exitCode () const |
Utility class that runs a nap::BaseApp until BaseApp::quit() is called or AppRunner::stop(). The APP template argument should be derived from nap::BaseApp, HANDLER should be of type nap::BaseAppEventHandler()
When creating an AppRunner with those two template arguments the app is created and invoked at the right time based on core and it's associated services. Note that the AppRunner owns the app and handler.
On start() the runner initializes nap::Core, together with all available services and loads the application data. If everything succeeds the app loop is started.
Constructor
core | the nap core this runner uses in conjunction with the app and handler |
|
virtual |
Destructor
int exitCode | ( | ) | const |
APP & getApp |
HANDLER & getHandler |
bool start | ( | utility::ErrorState & | error | ) |
Starts the app loop, if the loop could not start for some reason the error contains the reason. This call will initialize core and the application and run the application loop until AppRunner::stop() or BaseApp::quit() is invoked.
error | the error message if the loop couldn't be started |
void stop |
Stops the loop and exits the application