diff options
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; |
