Application-wide state for the promeki library. More...
#include <application.h>

Public Member Functions | |
| Application (int argc, char **argv) | |
| Constructs and registers an Application instance. | |
| ~Application () | |
| Destroys the Application and clears the current instance. | |
| Application (const Application &)=delete | |
| Application (Application &&)=delete | |
| Application & | operator= (const Application &)=delete |
| Application & | operator= (Application &&)=delete |
Static Public Member Functions | |
| static const StringList & | arguments () |
| Returns the command-line arguments. | |
| static const UUID & | appUUID () |
| Returns the application UUID used as a namespace for UUID v3/v5 generation. | |
| static void | setAppUUID (const UUID &uuid) |
| Sets the application UUID used as a namespace for UUID v3/v5 generation. | |
| static const String & | appName () |
| Returns the application name used for UUID v3/v5 generation. | |
| static void | setAppName (const String &name) |
| Sets the application name used for UUID v3/v5 generation. | |
| static Thread * | mainThread () |
| Returns the Thread object for the main (application) thread. | |
| static EventLoop * | mainEventLoop () |
| Returns the EventLoop for the main thread. | |
| static IODevice * | stdinDevice () |
| Returns an IODevice wrapping C stdin. | |
| static IODevice * | stdoutDevice () |
| Returns an IODevice wrapping C stdout. | |
| static IODevice * | stderrDevice () |
| Returns an IODevice wrapping C stderr. | |
Application-wide state for the promeki library.
Provides global application identity (name, UUID, command-line arguments) used by other parts of the library such as UUID v3/v5 generation.
All accessors are static and work whether or not an instance has been constructed. Optionally, an Application object can be created on the stack in main() to capture argc/argv and register as the current instance (similar to QApplication):
If no instance is created, the static accessors operate on default-constructed internal state.
| Application::Application | ( | int | argc, |
| char ** | argv | ||
| ) |
Constructs and registers an Application instance.
| argc | Argument count from main(). |
| argv | Argument vector from main(). |
Stores the command-line arguments and sets this as the current Application. Only one instance should exist at a time.
Returns the application name used for UUID v3/v5 generation.
|
static |
Returns the command-line arguments.
Returns the Thread object for the main (application) thread.
Sets the application name used for UUID v3/v5 generation.
| name | The application name to use. |
Returns an IODevice wrapping C stderr.
The returned device is a lazy-initialized static local FileIODevice opened for WriteOnly. It does not own the FILE pointer.
Returns an IODevice wrapping C stdin.
The returned device is a lazy-initialized static local FileIODevice opened for ReadOnly. It does not own the FILE pointer.
Returns an IODevice wrapping C stdout.
The returned device is a lazy-initialized static local FileIODevice opened for WriteOnly. It does not own the FILE pointer.