139baaf62Sopenharmony_ci/* 239baaf62Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 339baaf62Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 439baaf62Sopenharmony_ci * you may not use this file except in compliance with the License. 539baaf62Sopenharmony_ci * You may obtain a copy of the License at 639baaf62Sopenharmony_ci * 739baaf62Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 839baaf62Sopenharmony_ci * 939baaf62Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1039baaf62Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1139baaf62Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1239baaf62Sopenharmony_ci * See the License for the specific language governing permissions and 1339baaf62Sopenharmony_ci * limitations under the License. 1439baaf62Sopenharmony_ci */ 1539baaf62Sopenharmony_ci 1639baaf62Sopenharmony_ci#ifndef HIVIEWDFX_CAUTION_H 1739baaf62Sopenharmony_ci#define HIVIEWDFX_CAUTION_H 1839baaf62Sopenharmony_ci 1939baaf62Sopenharmony_ci#include <string> 2039baaf62Sopenharmony_ci 2139baaf62Sopenharmony_cinamespace OHOS { 2239baaf62Sopenharmony_cinamespace HiviewDFX { 2339baaf62Sopenharmony_ciclass Caution { 2439baaf62Sopenharmony_cipublic: 2539baaf62Sopenharmony_ci Caution() : triggerRule_(0ULL) {} 2639baaf62Sopenharmony_ci Caution(uint64_t triggerRule, const std::string& cautionMsg): triggerRule_(triggerRule), 2739baaf62Sopenharmony_ci cautionMsg_(cautionMsg) {} 2839baaf62Sopenharmony_ci Caution(uint64_t triggerRule, const std::string& cautionMsg, const std::string& stackTrace) 2939baaf62Sopenharmony_ci : triggerRule_(triggerRule), cautionMsg_(cautionMsg), stackTrace_(stackTrace) {} 3039baaf62Sopenharmony_ci ~Caution() {} 3139baaf62Sopenharmony_ci Caution(const Caution&) = default; 3239baaf62Sopenharmony_ci Caution& operator = (Caution&) = default; 3339baaf62Sopenharmony_ci void SetTriggerRule(uint64_t rule); 3439baaf62Sopenharmony_ci void SetCautionMsg(const std::string& cautionMsg); 3539baaf62Sopenharmony_ci void SetStackTrace(const std::string& stackTrace); 3639baaf62Sopenharmony_ci uint64_t GetTriggerRule() const; 3739baaf62Sopenharmony_ci std::string GetCautionMsg() const; 3839baaf62Sopenharmony_ci std::string GetStackTrace() const; 3939baaf62Sopenharmony_ciprivate: 4039baaf62Sopenharmony_ci uint64_t triggerRule_; 4139baaf62Sopenharmony_ci std::string cautionMsg_; 4239baaf62Sopenharmony_ci std::string stackTrace_; 4339baaf62Sopenharmony_ci}; 4439baaf62Sopenharmony_ci} // HiviewDFX 4539baaf62Sopenharmony_ci} // OHOS 4639baaf62Sopenharmony_ci#endif // HIVIEWDFX_CAUTION_H