openMSX
BreakPointBase.hh
Go to the documentation of this file.
1 #ifndef BREAKPOINTBASE_HH
2 #define BREAKPOINTBASE_HH
3 
4 #include "TclObject.hh"
5 #include "noncopyable.hh"
6 #include "string_ref.hh"
7 #include <memory>
8 
9 struct Tcl_Interp;
10 
11 namespace openmsx {
12 
13 class GlobalCliComm;
14 
17 class BreakPointBase : private noncopyable
18 {
19 public:
20  string_ref getCondition() const { return condition.getString(); }
21  string_ref getCommand() const { return command .getString(); }
22  TclObject getConditionObj() const { return condition; }
23  TclObject getCommandObj() const { return command; }
24 
25  void checkAndExecute();
26 
27  // get associated interpreter
28  Tcl_Interp* getInterpreter() const;
29 
30 protected:
31  // Note: we require GlobalCliComm here because breakpoint objects can
32  // be transfered to different MSX machines, and so the MSXCliComm
33  // object won't remain valid.
35  TclObject command, TclObject condition);
36 
37 private:
38  bool isTrue() const;
39 
40  GlobalCliComm& cliComm;
41  TclObject command;
42  TclObject condition;
43  bool executing;
44 };
45 
46 } // namespace openmsx
47 
48 #endif