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#ifndef FAULT_LEVEL_THREAD_HOLD_H
16#define FAULT_LEVEL_THREAD_HOLD_H
17
18#include <string>
19#include <climits>
20
21namespace OHOS {
22namespace HiviewDFX {
23const int DEFAULT_LEVEL_A = UINT_MAX;
24const int DEFAULT_LEVEL_B = UINT_MAX;
25const int DEFAULT_LEVEL_C = UINT_MAX;
26const std::string DEFAULT_COMMENT = "";
27const int DEFAULT_DUMP_BITMAP = 0;
28
29struct FaultLevelThreshold {
30    unsigned int levelA{UINT_MAX}; /* A standard --total time span,0-invalid,unit:ms */
31    unsigned int levelB{UINT_MAX}; /* B standard --total time span,0-invalid,unit:ms */
32    unsigned int levelC{UINT_MAX}; /* C standard --total time span,0-invalid,unit:ms */
33    unsigned int dumpBitmap{DEFAULT_DUMP_BITMAP};
34    std::string comment{DEFAULT_COMMENT};
35    FaultLevelThreshold()
36    {
37        this->levelA = DEFAULT_LEVEL_A;
38        this->levelB = DEFAULT_LEVEL_B;
39        this->levelC = DEFAULT_LEVEL_C;
40        this->comment = DEFAULT_COMMENT;
41        this->dumpBitmap = DEFAULT_DUMP_BITMAP;
42    }
43    FaultLevelThreshold(const FaultLevelThreshold& faultLevelThreshold)
44    {
45        this->levelA = faultLevelThreshold.levelA;
46        this->levelB = faultLevelThreshold.levelB;
47        this->levelC = faultLevelThreshold.levelC;
48        this->comment = faultLevelThreshold.comment;
49        this->dumpBitmap = faultLevelThreshold.dumpBitmap;
50    }
51    FaultLevelThreshold& operator=(const FaultLevelThreshold& faultLevelThreshold)
52    {
53        this->levelA = faultLevelThreshold.levelA;
54        this->levelB = faultLevelThreshold.levelB;
55        this->levelC = faultLevelThreshold.levelC;
56        this->comment = faultLevelThreshold.comment;
57        this->dumpBitmap = faultLevelThreshold.dumpBitmap;
58        return *this;
59    }
60};
61} // HiviewDFX
62} // OHOS
63#endif