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 
8 struct Tcl_Interp;
9 
10 namespace openmsx {
11 
12 class GlobalCliComm;
13 
16 class BreakPointBase : private noncopyable
17 {
18 public:
19  string_ref getCondition() const { return condition.getString(); }
20  string_ref getCommand() const { return command .getString(); }
21  TclObject getConditionObj() const { return condition; }
22  TclObject getCommandObj() const { return command; }
23 
24  void checkAndExecute();
25 
26  // get associated interpreter
27  Tcl_Interp* getInterpreter() const;
28 
29 protected:
30  // Note: we require GlobalCliComm here because breakpoint objects can
31  // be transfered to different MSX machines, and so the MSXCliComm
32  // object won't remain valid.
34  TclObject command, TclObject condition);
35 
36 private:
37  bool isTrue() const;
38 
39  GlobalCliComm& cliComm;
40  TclObject command;
41  TclObject condition;
42  bool executing;
43 };
44 
45 } // namespace openmsx
46 
47 #endif
TclObject getConditionObj() const
string_ref getString() const
Definition: TclObject.cc:213
string_ref getCondition() const
string_ref getCommand() const
This class implements a subset of the proposal for std::string_ref (proposed for the next c++ standar...
Definition: string_ref.hh:18
TclObject getCommandObj() const
BreakPointBase(GlobalCliComm &cliComm, TclObject command, TclObject condition)
Base class for CPU break and watch points.
Tcl_Interp * getInterpreter() const
Based on boost::noncopyable, see boost documentation: http://www.boost.org/libs/utility.
Definition: noncopyable.hh:12