libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
application.h
Go to the documentation of this file.
1
9#pragma once
10
12#include <promeki/core/string.h>
14#include <promeki/core/uuid.h>
15
17class Thread;
18class EventLoop;
19class IODevice;
21
23
48 public:
58 Application(int argc, char **argv);
59
62
63 Application(const Application &) = delete;
64 Application(Application &&) = delete;
65 Application &operator=(const Application &) = delete;
66 Application &operator=(Application &&) = delete;
67
73 static const StringList &arguments();
74
79 static const UUID &appUUID();
80
85 static void setAppUUID(const UUID &uuid);
86
91 static const String &appName();
92
97 static void setAppName(const String &name);
98
104
111
122
133
144
145 private:
146 struct Data {
147 StringList arguments;
148 UUID appUUID;
149 String appName;
150 Thread *mainThread = nullptr;
151 };
152 static Data &data();
153};
154
Application-wide state for the promeki library.
Definition application.h:47
static const StringList & arguments()
Returns the command-line arguments.
static IODevice * stderrDevice()
Returns an IODevice wrapping C stderr.
~Application()
Destroys the Application and clears the current instance.
Application(int argc, char **argv)
Constructs and registers an Application instance.
static EventLoop * mainEventLoop()
Returns the EventLoop for the main thread.
static const UUID & appUUID()
Returns the application UUID used as a namespace for UUID v3/v5 generation.
static IODevice * stdinDevice()
Returns an IODevice wrapping C stdin.
static void setAppName(const String &name)
Sets the application name used for UUID v3/v5 generation.
static const String & appName()
Returns the application name used 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 IODevice * stdoutDevice()
Returns an IODevice wrapping C stdout.
static Thread * mainThread()
Returns the Thread object for the main (application) thread.
Per-thread event loop providing event dispatch, timers, and posted callables.
Definition eventloop.h:58
Abstract base class for all I/O devices.
Definition iodevice.h:29
Dynamic array container wrapping std::vector.
Definition list.h:40
Manages a list of strings.
Definition stringlist.h:21
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
Wrapper around std::thread with a built-in EventLoop.
Definition thread.h:48
Universally Unique Identifier (UUID).
Definition uuid.h:34
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19