Load radar data asynchronously

This commit is contained in:
Dan Paulat 2021-11-11 23:47:27 -06:00
parent 803a25e884
commit 3625515b8a
6 changed files with 71 additions and 13 deletions

View 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

View file

@ -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