1#ifndef COVISE_UTIL_ASYNC_WAIT
2#define COVISE_UTIL_ASYNC_WAIT
26typedef std::vector<std::unique_ptr<AsyncWaitInterface>>
AsyncWaits;
32template <
typename Param>
50 m_future = std::async(std::launch::async, [
this]() {
60 if (
m_future.valid() &&
m_future.wait_for(std::chrono::seconds(0)) == std::future_status::ready)
72 template <
typename OtherParam>
99 { return ptr.get() == next; }));
108 std::future<std::unique_ptr<Param>>
m_future;
115template <
typename Param>
#define UTILEXPORT
Definition: coExport.h:206
const GLubyte * c
Definition: khronos-glext.h:9864
GLenum condition
Definition: khronos-glext.h:10218
GLdouble GLdouble GLdouble r
Definition: khronos-glext.h:6457
list of all chemical elements
Definition: coConfig.h:27
UTILEXPORT AsyncWaits asyncWaits
Definition: asyncWait.cpp:7
AsyncWaitClass< Param > & AsyncWait(std::function< Param(void)> condition, std::function< bool(const Param &)> response)
Definition: asyncWait.h:116
void UTILEXPORT handleAsyncWaits()
Definition: asyncWait.cpp:9
std::vector< std::unique_ptr< AsyncWaitInterface > > AsyncWaits
Definition: asyncWait.h:26
Definition: asyncWait.h:18
virtual bool operator()()=0
virtual ~AsyncWaitInterface()=default
Definition: asyncWait.h:34
AsyncWaitClass(Condition condition, Response response)
Definition: asyncWait.h:38
~AsyncWaitClass()=default
std::future< Param > m_future
Definition: asyncWait.h:110
AsyncWaitClass & operator=(AsyncWaitClass &&)=delete
AsyncWaitClass(const AsyncWaitClass &)=delete
void remove() override
Definition: asyncWait.h:93
void wait()
Definition: asyncWait.h:47
AsyncWaitClass(AsyncWaitClass &&other)=delete
std::function< Param(void)> Condition
Definition: asyncWait.h:36
Response m_response
Definition: asyncWait.h:105
AsyncWaitClass & operator=(const AsyncWaitClass &)=delete
std::function< bool(const Param &)> Response
Definition: asyncWait.h:37
AsyncWaitClass< OtherParam > & operator>>(AsyncWaitClass< OtherParam > &c)
Definition: asyncWait.h:73
Condition m_condition
Definition: asyncWait.h:106
bool operator()() override
Definition: asyncWait.h:58
AsyncWaitInterface * next
Definition: asyncWait.h:112
Definition: covise_msg.h:137