1 /*
2  * Copyright (c) 2024 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 HDF_UHDF_UTILS_INCLUDE_HDF_XCOLLIE_H
17 #define HDF_UHDF_UTILS_INCLUDE_HDF_XCOLLIE_H
18 
19 #include <string>
20 #ifdef HDFHICOLLIE_ENABLE
21 #include "xcollie/xcollie.h"
22 #else
23 #include "singleton.h"
24 #endif
25 
26 namespace OHOS {
27 #ifdef HDFHICOLLIE_ENABLE
28 using HdfXCollie = ::OHOS::HiviewDFX::XCollie;
29 #else
30 class HdfXCollie : public Singleton<HdfXCollie> {
31     DECLARE_SINGLETON(HdfXCollie);
32 public:
33     // NULL impl
34     int SetTimer(const std::string &name, unsigned int timeout,
35         std::function<void (void *)> func, void *arg, unsigned int flag);
36 
37     // NULL impl
38     void CancelTimer(int id);
39 
40     // NULL impl
41     int SetTimerCount(const std::string &name, unsigned int timeLimit, int countLimit);
42 
43     // NULL impl
44     void TriggerTimerCount(const std::string &name, bool bTrigger, const std::string &message);
45 };
46 #endif
47 }
48 #endif // HDF_UHDF_UTILS_INCLUDE_HDF_XCOLLIE_H