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
82
83 public:
84
88 virtual ~ObserverInterface() = default;
89
94 virtual void set_up(size_t num_workers) = 0;
95
101 virtual void on_entry(WorkerView wv, TaskView task_view) = 0;
102
108 virtual 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
virtual void on_entry(WorkerView wv, TaskView task_view)=0
method to call before a worker thread executes a closure
virtual void on_exit(WorkerView wv, TaskView task_view)=0
method to call after a worker thread executed a closure
virtual ~ObserverInterface()=default
virtual destructor
class to access task information from the observer interface
Definition task.hpp:1240
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