mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 07:50:04 +00:00
Load radar data asynchronously
This commit is contained in:
parent
803a25e884
commit
3625515b8a
6 changed files with 71 additions and 13 deletions
16
wxdata/include/scwx/util/threads.hpp
Normal file
16
wxdata/include/scwx/util/threads.hpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include <future>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
template<class F>
|
||||
void async(F&& f)
|
||||
{
|
||||
auto future = std::make_shared<std::future<void>>();
|
||||
*future = std::async(std::launch::async, [future, f]() { f(); });
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace scwx
|
||||
|
|
@ -11,6 +11,7 @@ set(SRC_COMMON source/scwx/common/color_table.cpp
|
|||
set(HDR_UTIL include/scwx/util/iterator.hpp
|
||||
include/scwx/util/rangebuf.hpp
|
||||
include/scwx/util/streams.hpp
|
||||
include/scwx/util/threads.hpp
|
||||
include/scwx/util/vectorbuf.hpp)
|
||||
set(SRC_UTIL source/scwx/util/rangebuf.cpp
|
||||
source/scwx/util/streams.cpp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue