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.h" 19 #include "cpp/task.h" 20 21 namespace ffrt { 22 class task_attr_private { 23 public: task_attr_private()24 task_attr_private() 25 : qos_(static_cast<int>(qos_default)) 26 { 27 } 28 task_attr_private(const task_attr attr)29 explicit task_attr_private(const task_attr attr) 30 : qos_(attr.qos()), 31 name_(attr.name()), 32 delay_(attr.delay()) 33 { 34 } 35 36 int qos_; 37 std::string name_; 38 uint64_t delay_ = 0; 39 uint64_t timeout_ = 0; 40 ffrt_function_header_t* timeoutCb_ = nullptr; 41 }; 42 } 43 #endif 44