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 #include "debug_step_flags.h" 17 Get()18DebugStepFlags& DebugStepFlags::Get() 19 { 20 static DebugStepFlags instance; 21 return instance; 22 } 23 24 // 设置函数实现 SetDyn2StatInto(bool value)25void DebugStepFlags::SetDyn2StatInto(bool value) 26 { 27 std::lock_guard<std::mutex> lock(mutex_); 28 dyn2statInto_ = value; 29 } 30 SetDyn2StatOut(bool value)31void DebugStepFlags::SetDyn2StatOut(bool value) 32 { 33 std::lock_guard<std::mutex> lock(mutex_); 34 dyn2statOut_ = value; 35 } 36 SetDyn2StatOver(bool value)37void DebugStepFlags::SetDyn2StatOver(bool value) 38 { 39 std::lock_guard<std::mutex> lock(mutex_); 40 dyn2statOver_ = value; 41 } 42 SetStat2DynInto(bool value)43void DebugStepFlags::SetStat2DynInto(bool value) 44 { 45 std::lock_guard<std::mutex> lock(mutex_); 46 stat2dynInto_ = value; 47 } 48 SetStat2DynOut(bool value)49void DebugStepFlags::SetStat2DynOut(bool value) 50 { 51 std::lock_guard<std::mutex> lock(mutex_); 52 stat2dynOut_ = value; 53 } 54 SetStat2DynOver(bool value)55void DebugStepFlags::SetStat2DynOver(bool value) 56 { 57 std::lock_guard<std::mutex> lock(mutex_); 58 stat2dynOver_ = value; 59 } 60 GetDyn2StatInto()61bool DebugStepFlags::GetDyn2StatInto() 62 { 63 std::lock_guard<std::mutex> lock(mutex_); 64 return dyn2statInto_; 65 } 66 GetDyn2StatOut()67bool DebugStepFlags::GetDyn2StatOut() 68 { 69 std::lock_guard<std::mutex> lock(mutex_); 70 return dyn2statOut_; 71 } 72 GetDyn2StatOver()73bool DebugStepFlags::GetDyn2StatOver() 74 { 75 std::lock_guard<std::mutex> lock(mutex_); 76 return dyn2statOver_; 77 } 78 GetStat2DynInto()79bool DebugStepFlags::GetStat2DynInto() 80 { 81 std::lock_guard<std::mutex> lock(mutex_); 82 return stat2dynInto_; 83 } 84 GetStat2DynOut()85bool DebugStepFlags::GetStat2DynOut() 86 { 87 std::lock_guard<std::mutex> lock(mutex_); 88 return stat2dynOut_; 89 } 90 GetStat2DynOver()91bool DebugStepFlags::GetStat2DynOver() 92 { 93 std::lock_guard<std::mutex> lock(mutex_); 94 return stat2dynOver_; 95 }