Debian Codegraph @

Source/Core/Common/Debug/Watches.h

raw symbols SCIP
1 // Copyright 2018 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <cstddef>
7 #include <span>
8 #include <string>
9 #include <vector>
10
11 #include "Common/CommonTypes.h"
12
13 namespace Common::Debug
14 {
15 struct Watch
16 {
17 enum class State : bool
18 {
19 Enabled = true,
20 Disabled = false
21 };
22
23 u32 address;
24 std::string name;
25 State is_enabled;
26 bool locked = false;
27
28 Watch(u32 address, std::string name, State is_enabled);
29 };
30
31 class Watches
32 {
33 public:
34 std::size_t SetWatch(u32 address, std::string name);
35 const Watch& GetWatch(std::size_t index) const;
36 const std::vector<Watch>& GetWatches() const;
37 void UnsetWatch(u32 address);
38 void UpdateWatch(std::size_t index, u32 address, std::string name);
39 void UpdateWatchAddress(std::size_t index, u32 address);
40 void UpdateWatchName(std::size_t index, std::string name);
41 void UpdateWatchLockedState(std::size_t index, bool locked);
42 void EnableWatch(std::size_t index);
43 void DisableWatch(std::size_t index);
44 bool HasEnabledWatch(u32 address) const;
45 void RemoveWatch(std::size_t index);
46 void LoadFromStrings(std::span<const std::string> watches);
47 std::vector<std::string> SaveToStrings() const;
48 void Clear();
49
50 private:
51 std::vector<Watch> m_watches;
52 };
53 } // namespace Common::Debug