docs/interface_8hpp_source.html
| | Taskflow: A General-purpose Task-parallel Programming System |
Loading...
Searching...
No Matches
interface.hpp
1#pragma once
2
3#include "../core/task.hpp"
4#include "../core/worker.hpp"
5
10
11namespace tf {
12
13// ----------------------------------------------------------------------------
14// common observer types
15// ----------------------------------------------------------------------------
16
20using observer_stamp_t = std::chrono::time_point<std::chrono::steady_clock>;
21
22// ----------------------------------------------------------------------------
23// ObserverInterface
24// ----------------------------------------------------------------------------
25
81class ObserverInterface {
82
83public:
84
88virtual ~ObserverInterface() = default;
89
94virtual void set_up(size_t num_workers) = 0;
95
101virtual void on_entry(WorkerView wv, TaskView task_view) = 0;
102
108virtual void on_exit(WorkerView wv, TaskView task_view) = 0;
109};
110
111} // end of namespace tf -----------------------------------------------------
class to derive an executor observer
Definition interface.hpp:81
virtual void set_up(size_t num_workers)=0
constructor-like method to call when the executor observer is fully created
tf::ObserverInterface::on_entry
virtual void on_entry(WorkerView wv, TaskView task_view)=0
method to call before a worker thread executes a closure
tf::ObserverInterface::on_exit
virtual void on_exit(WorkerView wv, TaskView task_view)=0
method to call after a worker thread executed a closure
tf::ObserverInterface::~ObserverInterface
virtual ~ObserverInterface()=default
virtual destructor
class to access task information from the observer interface
Definition task.hpp:1546
class to create an immutable view of a worker
Definition worker.hpp:116
taskflow namespace
Definition small_vector.hpp:20
std::chrono::time_point< std::chrono::steady_clock > observer_stamp_t
default time point type of observers
Definition interface.hpp:20