summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/task/function-task.hh
blob: a08b285e861d2479a645991de389ff59e0216968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
 ** \file task/function-task.hh
 ** \brief Declare the task::FunctionTask class.
 **
 */
#pragma once

#include <task/simple-task.hh>

namespace task
{
  /// A simple Task that invokes a callback function.
  class FunctionTask : public SimpleTask
  {
  public:
    using callback_type = auto() -> void;

    FunctionTask(callback_type& callback,
                 const char* module_name,
                 const char* desc,
                 const char* name,
                 std::string deps);

  public:
    void execute() const override;

  private:
    callback_type& execute_;
  };

} //namespace task