• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 
16 #ifndef INTERFACES_KITS_JS_SRC_MOD_FS_CLASS_TASKSIGNAL_FS_TASK_SIGNAL_H
17 #define INTERFACES_KITS_JS_SRC_MOD_FS_CLASS_TASKSIGNAL_FS_TASK_SIGNAL_H
18 
19 #include "filemgmt_libfs.h"
20 #include "task_signal.h"
21 
22 namespace OHOS {
23 namespace FileManagement {
24 namespace ModuleFileIO {
25 using namespace std;
26 using namespace DistributedFS::ModuleTaskSignal;
27 
28 class FsTaskSignal {
29 public:
30     static FsResult<unique_ptr<FsTaskSignal>> Constructor(
31         shared_ptr<TaskSignal> taskSignal, shared_ptr<TaskSignalListener> signalListener);
32     FsResult<void> Cancel();
33     FsResult<void> OnCancel();
34     shared_ptr<TaskSignal> GetTaskSignal() const;
35     FsTaskSignal();
36     ~FsTaskSignal() = default;
37     FsTaskSignal(const FsTaskSignal &other) = delete;
38     FsTaskSignal &operator=(const FsTaskSignal &other) = delete;
39 
40 private:
41     shared_ptr<TaskSignal> taskSignal_ = nullptr;
42     shared_ptr<TaskSignalListener> signalListener_ = nullptr;
43 };
44 
45 } // namespace ModuleFileIO
46 } // namespace FileManagement
47 } // namespace OHOS
48 #endif // INTERFACES_KITS_JS_SRC_MOD_FS_CLASS_TASKSIGNAL_FS_TASK_SIGNAL_H