1 #ifndef VTESTBED_GUI_TASK_HH     2 #define VTESTBED_GUI_TASK_HH    30             template <
class Function>
    32             run(Function 
function) {
    33                 this->_state = State::Running;
    38                             this->_exception = 
nullptr;
    40                             this->_exception = std::current_exception();
    42                         this->_state = State::Finished;
    49                 return this->_state == State::Initial;
    54                 return this->_state == State::Finished;
    59                 return this->_state == State::Running;
    64                 if (this->_thread.joinable()) {
    67                 auto ptr = this->_exception;
    70                     std::rethrow_exception(ptr);
    76                 this->_exception = 
nullptr;
    77                 this->_state = State::Initial;
    86 #endif // vim:filetype=cpp