1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef TASK_ATTR_PRIVATE_H
16 #define TASK_ATTR_PRIVATE_H
17 #include <string>
18 #include "c/type_def_ext.h"
19 #include "cpp/task_ext.h"
20 #include "qos.h"
21 #include "eu/co_routine.h"
22 
23 namespace ffrt {
24 class task_attr_private {
25 public:
task_attr_private()26     task_attr_private()
27         : qos_(qos_default)
28     {
29     }
30 
task_attr_private(const task_attr attr)31     explicit task_attr_private(const task_attr attr)
32         : qos_(attr.qos()),
33           name_(attr.name()),
34           delay_(attr.delay()),
35           prio_(attr.priority())
36     {
37     }
38 
39     int qos_;
40     std::string name_;
41     uint64_t delay_ = 0;
42     uint64_t timeout_ = 0;
43     bool notifyWorker_ = true;
44     ffrt_queue_priority_t prio_ = ffrt_queue_priority_low;
45     bool taskLocal_ = false;
46     ffrt_function_header_t* timeoutCb_ = nullptr;
47     uint64_t stackSize_ = STACK_SIZE;
48 };
49 }
50 #endif
51