1816fd32cSopenharmony_ci/*
2816fd32cSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3816fd32cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4816fd32cSopenharmony_ci * you may not use this file except in compliance with the License.
5816fd32cSopenharmony_ci * You may obtain a copy of the License at
6816fd32cSopenharmony_ci *
7816fd32cSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
8816fd32cSopenharmony_ci *
9816fd32cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10816fd32cSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11816fd32cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12816fd32cSopenharmony_ci * See the License for the specific language governing permissions and
13816fd32cSopenharmony_ci * limitations under the License.
14816fd32cSopenharmony_ci */
15816fd32cSopenharmony_ci
16816fd32cSopenharmony_ci#ifndef DISTRIBUTEDDATAMGR_DATA_SHARE_HITRACE_H
17816fd32cSopenharmony_ci#define DISTRIBUTEDDATAMGR_DATA_SHARE_HITRACE_H
18816fd32cSopenharmony_ci
19816fd32cSopenharmony_ci#include <string>
20816fd32cSopenharmony_ci
21816fd32cSopenharmony_ci#include "hitrace_meter.h"
22816fd32cSopenharmony_ci
23816fd32cSopenharmony_cinamespace OHOS {
24816fd32cSopenharmony_cinamespace DataShare {
25816fd32cSopenharmony_ciclass HiTrace final {
26816fd32cSopenharmony_cipublic:
27816fd32cSopenharmony_ci    inline HiTrace(const std::string &value)
28816fd32cSopenharmony_ci    {
29816fd32cSopenharmony_ci        StartTrace(HITRACE_TAG_DISTRIBUTEDDATA, value);
30816fd32cSopenharmony_ci    }
31816fd32cSopenharmony_ci
32816fd32cSopenharmony_ci    inline ~HiTrace()
33816fd32cSopenharmony_ci    {
34816fd32cSopenharmony_ci        FinishTrace(HITRACE_TAG_DISTRIBUTEDDATA);
35816fd32cSopenharmony_ci    }
36816fd32cSopenharmony_ci};
37816fd32cSopenharmony_ci} // namespace DataShare
38816fd32cSopenharmony_ci} // namespace OHOS
39816fd32cSopenharmony_ci
40816fd32cSopenharmony_ci#endif