| 1 |
#ifndef BREAKPOINTSMAP_HPP |
| 2 |
#define BREAKPOINTSMAP_HPP |
| 3 |
|
| 4 |
#include "dap/dap.hpp" |
| 5 |
|
| 6 |
class SessionBreakpoints |
| 7 |
{ |
| 8 |
std::vector<dap::Breakpoint> m_breakpoints; |
| 9 |
|
| 10 |
private: |
| 11 |
int find_by_id_internal(int id); |
| 12 |
size_t find_by_path_internal(const wxString& path, std::vector<dap::Breakpoint>* bps); |
| 13 |
|
| 14 |
public: |
| 15 |
SessionBreakpoints(); |
| 16 |
~SessionBreakpoints(); |
| 17 |
|
| 18 |
/** |
| 19 |
* @brief clear all the stored breakpoints |
| 20 |
*/ |
| 21 |
void clear(); |
| 22 |
|
| 23 |
/** |
| 24 |
* @brief find breakpoint by ID |
| 25 |
*/ |
| 26 |
bool find_by_id(int id, dap::Breakpoint* bp); |
| 27 |
|
| 28 |
/** |
| 29 |
* @brief return all breakpoints belonged to path |
| 30 |
*/ |
| 31 |
size_t find_by_path(const wxString& path, std::vector<dap::Breakpoint>* bps); |
| 32 |
|
| 33 |
/** |
| 34 |
* @brief update or insert. this is done by the id property of bp |
| 35 |
*/ |
| 36 |
bool update_or_insert(const dap::Breakpoint& bp); |
| 37 |
|
| 38 |
/** |
| 39 |
* @brief update list of breakpoints |
| 40 |
*/ |
| 41 |
void bulk_update(const std::vector<dap::Breakpoint>& list); |
| 42 |
|
| 43 |
// getters |
| 44 |
const std::vector<dap::Breakpoint>& get_breakpoints() const { return m_breakpoints; } |
| 45 |
|
| 46 |
/** |
| 47 |
* @brief delete breakpoint by ID |
| 48 |
*/ |
| 49 |
void delete_by_id(int id); |
| 50 |
|
| 51 |
/** |
| 52 |
* @brief delete all breakpoints belonged to path |
| 53 |
*/ |
| 54 |
void delete_by_path(const wxString& path); |
| 55 |
/** |
| 56 |
* @brief given list of breakpoints, delete all the breakpoints with similar paths |
| 57 |
*/ |
| 58 |
void delete_by_paths(const std::vector<dap::Breakpoint>& bps); |
| 59 |
}; |
| 60 |
|
| 61 |
#endif // BREAKPOINTSMAP_HPP |