diff options
author | vng <viktor.govako@gmail.com> | 2011-12-14 22:27:40 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:30:16 +0300 |
commit | eb03ebc866feccbb3c1f814f81bd40e61a4e0ca0 (patch) | |
tree | bacf070e4f5d1e827e74770f2cff6b40005097cd /platform/platform.hpp | |
parent | c96b27fb33462c008b3235beb4f3871e63461c4d (diff) |
Add interface for concurrent running.
Diffstat (limited to 'platform/platform.hpp')
-rw-r--r-- | platform/platform.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/platform.hpp b/platform/platform.hpp index 8ea2e1bd79..634f3e8a11 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -7,6 +7,8 @@ #include "../std/string.hpp" #include "../std/vector.hpp" #include "../std/utility.hpp" +#include "../std/function.hpp" + DECLARE_EXCEPTION(FileAbsentException, RootException); DECLARE_EXCEPTION(NotImplementedException, RootException); @@ -67,6 +69,13 @@ public: static bool GetFileSizeByFullPath(string const & filePath, uint64_t & size); //@} + /// @name Functions for concurrent tasks. + //@{ + typedef function<void()> TFunctor; + inline void RunInGuiThread(TFunctor const & fn) { fn(); } + inline void RunAsync(TFunctor const & fn) { fn(); } + //@} + int CpuCores() const; double VisualScale() const; |