libtasks Documentation
1.6
Main Page
Namespaces
Classes
Files
File List
File Members
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
13
void
event_task::assign_worker
(
worker
*
worker
) {
14
if
(
dispatcher::mode::MULTI_LOOP
==
dispatcher::run_mode
()) {
15
if
(
nullptr
==
m_worker
) {
16
m_worker
= worker;
17
}
18
assert(worker ==
m_worker
);
19
}
20
}
21
22
void
event_task::notify_error
(
worker
*
worker
) {
23
const
tasks_exception
& e =
exception
();
24
for
(
auto
f :
m_error_funcs
) {
25
f(worker, e);
26
}
27
}
28
29
}
// tasks
event_task.h
tasks::event_task::notify_error
void notify_error(worker *worker=nullptr)
Definition:
event_task.cpp:22
tasks::dispatcher::run_mode
static mode run_mode()
Definition:
dispatcher.h:73
tasks::event_task::m_worker
worker * m_worker
Definition:
event_task.h:96
tasks::worker
Definition:
worker.h:55
tasks::tasks_exception
Tasks execption class.
Definition:
tasks_exception.h:73
tasks::event_task::assign_worker
void assign_worker(worker *worker)
Definition:
event_task.cpp:13
dispatcher.h
tasks::dispatcher::mode::MULTI_LOOP
tasks::event_task::m_error_funcs
std::vector< error_func_t > m_error_funcs
Definition:
event_task.h:97
tasks::error_base::exception
const tasks_exception & exception() const
Return the underlying exception object.
Definition:
error_base.h:49
tasks
event_task.cpp
Generated by
1.8.6