libtasks Documentation  1.6
event_task.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 ADTECH GmbH
3  * Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING)
4  *
5  * Author: Andreas Pohl
6  */
7 
8 #include <tasks/event_task.h>
9 #include <tasks/dispatcher.h>
10 
11 namespace tasks {
12 
15  if (nullptr == m_worker) {
16  m_worker = worker;
17  }
18  assert(worker == m_worker);
19  }
20 }
21 
23  const tasks_exception& e = exception();
24  for (auto f : m_error_funcs) {
25  f(worker, e);
26  }
27 }
28 
29 } // tasks
void notify_error(worker *worker=nullptr)
Definition: event_task.cpp:22
static mode run_mode()
Definition: dispatcher.h:73
worker * m_worker
Definition: event_task.h:96
Tasks execption class.
void assign_worker(worker *worker)
Definition: event_task.cpp:13
std::vector< error_func_t > m_error_funcs
Definition: event_task.h:97
const tasks_exception & exception() const
Return the underlying exception object.
Definition: error_base.h:49