Taskflow  2.7.0
tf::ObserverInterface Class Referenceabstract

The interface class for creating an executor observer. More...

#include <observer.hpp>

Inheritance diagram for tf::ObserverInterface:

Public Member Functions

virtual ~ObserverInterface ()=default
 virtual destructor
 
virtual void set_up (size_t num_workers)=0
 constructor-like method to call when the executor observer is fully created More...
 
virtual void on_entry (size_t worker_id, TaskView task_view)=0
 method to call before a worker thread executes a closure More...
 
virtual void on_exit (size_t worker_id, TaskView task_view)=0
 method to call after a worker thread executed a closure More...
 

Friends

class Executor
 

Detailed Description

The interface class for creating an executor observer.

The tf::ExecutorObserver class let users define methods to monitor the behaviors of an executor. This is particularly useful when you want to inspect the performance of an executor.

Member Function Documentation

◆ on_entry()

virtual void tf::ObserverInterface::on_entry ( size_t  worker_id,
TaskView  task_view 
)
pure virtual

method to call before a worker thread executes a closure

Parameters
worker_idthe id of this worker thread
task_viewa constant wrapper object to the task

◆ on_exit()

virtual void tf::ObserverInterface::on_exit ( size_t  worker_id,
TaskView  task_view 
)
pure virtual

method to call after a worker thread executed a closure

Parameters
worker_idthe id of this worker thread
task_viewa constant wrapper object to the task

◆ set_up()

virtual void tf::ObserverInterface::set_up ( size_t  num_workers)
pure virtual

constructor-like method to call when the executor observer is fully created

Parameters
num_workersthe number of the worker threads in the executor

The documentation for this class was generated from the following file: