X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fapplication.h;h=35ab8734ef30fa08b7a9da21e3c854a9f30d24b1;hp=af18cea664b35eca77cc2148fd4db6815f5fadb6;hb=231482c618cb2b30e1f7194d8d1d3ea30bc94512;hpb=c0d3fd58fd25e4627a6f8d64a22c5800e783ce07 diff --git a/source/core/application.h b/source/core/application.h index af18cea..35ab873 100644 --- a/source/core/application.h +++ b/source/core/application.h @@ -27,12 +27,14 @@ protected: private: static Starter *starter_; static Application *app_; + static const char *argv0_; + static std::string name_; static void *data_; Application(const Application &); Application &operator=(const Application &); protected: - Application(); + Application(const std::string & = std::string()); public: virtual ~Application() { } @@ -45,6 +47,8 @@ public: static int run(int, char **, void * =0, void (*)(void *) = 0); static void *get_data() { return data_; } + static const char *get_argv0() { return argv0_; } + static const std::string &get_name() { return name_; } protected: /** Default main loop. Calls tick() repeatedly until exit() is called. A @@ -86,8 +90,9 @@ private: static Starter starter_; protected: - // Force the starter into existence - RegisteredApplication() { (void)starter_; } + RegisteredApplication(const std::string &n = std::string()): + Application(n) + { (void)starter_; } // Force the starter into existence }; template