Exemplo n.º 1
0
void Task::execute()
{
	m_status = TaskStatus::Running;
	try
	{
		m_action();
		m_status = TaskStatus::Completed;

        // post next tasks
        for (auto& n : m_nextTasks) {
            if (n.dispatcher) {
                n.dispatcher->post(n.task);
            }
        }
	}
	catch (Exception& e)
	{
		m_exception = e.copy();
		m_status = TaskStatus::Faulted;
	}
	catch (...)
	{
		m_exception = LN_NEW Exception();
		m_status = TaskStatus::Faulted;
	}
	m_waiting.unlock();
}
Exemplo n.º 2
0
 bool parse(Iterator& begin, Iterator end) const
 {
   Iterator o = begin;
   if (Parser::parse(begin, end))
   {
     m_action(o, begin);
     return true;
   }
   return false;
 }
Exemplo n.º 3
0
 bool operator () (const TPTree &tree) const
 {
     kvalue_type real_val = get(tree, m_key_name);
     if (real_val == m_key_value)
     {
         m_action(tree);
         return true;
     }
     return false;
 }
Exemplo n.º 4
0
 ~ScopeGuard()
 {
     m_action();
 }
Exemplo n.º 5
0
void TeleportWindowAction::execute(TeleportTarget *target)
{
	m_action(target);
}
	void run(){
		if(m_action)
			m_action();
	}