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           timeout_(attr.timeout()),
36           prio_(attr.priority())
37     {
38     }
39 
40     int qos_;
41     std::string name_;
42     uint64_t delay_ = 0;
43     uint64_t timeout_ = 0;
44     bool notifyWorker_ = true;
45     ffrt_queue_priority_t prio_ = ffrt_queue_priority_low;
46     bool taskLocal_ = false;
47     bool headInsert_ = false;
48     ffrt_function_header_t* timeoutCb_ = nullptr;
49     uint64_t stackSize_ = STACK_SIZE;
50 };
51 }
52 #endif
53