diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 07:06:20 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-11-26 07:06:20 -0500 |
| commit | 2c2c47c21502db6471fe7d727f942c2400b150c1 (patch) | |
| tree | 196108eb94119cbd9fd2abac5fc67dddbf37fa01 /src/env.h | |
| parent | 08bf03854d0688cd8dbbfed7d596888dbedfcb4b (diff) | |
log new modules being loaded after startup
Diffstat (limited to 'src/env.h')
| -rw-r--r-- | src/env.h | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -119,6 +119,27 @@ private: }; +class ModuleNotification +{ +public: + ModuleNotification(std::function<void (Module)> f); + ~ModuleNotification(); + + ModuleNotification(const ModuleNotification&) = delete; + ModuleNotification& operator=(const ModuleNotification&) = delete; + + ModuleNotification(ModuleNotification&&) = default; + ModuleNotification& operator=(ModuleNotification&&) = default; + + void setCookie(void* c); + void fire(const Module& m); + +private: + void* m_cookie; + std::function<void (Module)> m_f; +}; + + // represents the process's environment // class Environment @@ -151,6 +172,9 @@ public: // QString timezone() const; + std::unique_ptr<ModuleNotification> onModuleLoaded( + std::function<void (Module)> f); + // logs the environment // void dump(const Settings& s) const; |
