|
|
| Application (int argc=0, char **argv=0) |
| | Construct with command line arguments.
|
| |
|
| Application (EventLoop *loop, int argc=0, char **argv=0) |
| | Construct with custom event loop.
|
| |
|
| ~Application () |
| | Destructor.
|
| |
|
int | argc () const |
| | Number of command line arguments.
|
| |
|
char ** | argv () const |
| | Command line arguments.
|
| |
|
bool | catchSystemSignal (int sig) |
| | Catch a system signal.
|
| |
|
void | exit () |
| | Exits from the contained event loop.
|
| |
|
template<typename T > |
| Arg< T > | getArg (const char *name) |
| | Returns the value of a long option.
|
| |
|
template<typename T > |
| Arg< T > | getArg (const char *name, const T &def) |
| | Returns the value of a long option.
|
| |
|
template<typename T > |
| Arg< T > | getArg (const char name) |
| | Returns the value of a short option.
|
| |
|
template<typename T > |
| Arg< T > | getArg (const char name, const T &def) |
| | Returns the value of a short option.
|
| |
|
bool | ignoreSystemSignal (int sig) |
| | Ignores a system signal.
|
| |
|
EventLoop & | loop () |
| | Returns the event loop.
|
| |
|
bool | raiseSystemSignal (int sig) |
| | Raise a system signal.
|
| |
|
void | run () |
| | Starts the contained event loop.
|
| |
|
Signal< int > & | systemSignal () |
| | Notifies when a system signal was caught.
|
| |
This class is used by non-GUI applications to provide the central event loop, handle C signals and process command line arguments. There can be only one instance per application. The application and therefore the event loop is started with a call to run() and can be exited with a call to exit(). The event loop can be obtained by calling loop(). Command line arguments can be parsed as Arg and static methods exist to set environment variables.