You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Licensed under the Apache License, Version 2.0 (the "License");
5
+
* you may not use this file except in compliance with the License.
6
+
* You may obtain a copy of the License at
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
+
* Unless required by applicable law or agreed to in writing, software
11
+
* distributed under the License is distributed on an "AS IS" BASIS,
12
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
* See the License for the specific language governing permissions and
14
+
* limitations under the License.
15
+
*/
16
+
17
+
/**
18
+
* @file task.hpp
19
+
* @brief This file implements the TaskR task class
20
+
* @author Sergio Martin
21
+
* @date 29/7/2024
22
+
*/
23
+
24
+
#pragma once
25
+
26
+
#include<chrono>
27
+
#include<hicr/frontends/tasking/common.hpp>
28
+
#include"common.hpp"
29
+
#include"task.hpp"
30
+
31
+
namespacetaskr
32
+
{
33
+
34
+
/**
35
+
* This class defines a TaskR
36
+
*
37
+
* This is a function that is executed with a given frequency and is useful to detect asynchronous events, such as incoming messages
38
+
*
39
+
* Services are picked up by any free task / service worker and executed. While a service is executed, no other worker can execute it in parallel.
40
+
*
41
+
* Services do not represent the critical path of an application. Their presence not preclude taskR from finished when there are no tasks left to execute.
42
+
*/
43
+
classService
44
+
{
45
+
public:
46
+
47
+
/**
48
+
* The type of a service function
49
+
*/
50
+
typedef std::function<void()> serviceFc_t;
51
+
52
+
Service() = delete;
53
+
virtual~Service() = default;
54
+
55
+
/**
56
+
* Constructor for the TaskR task class. It requires a user-defined function to execute
57
+
* The task is considered finished when the function runs to completion.
58
+
*
59
+
* @param[in] fc Specifies the TaskR-formatted function to use
60
+
* @param[in] interval The minimum interval in ms between two executions of the service. Specify 0 for no minimum interval.
0 commit comments