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 class Interpreter;
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  Interpreter& getInterpreter() const { return interp; }
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.
33  BreakPointBase(GlobalCliComm& cliComm, Interpreter& interp,
34  TclObject command, TclObject condition);
35 
36 private:
37  bool isTrue() const;
38 
39  GlobalCliComm& cliComm;
40  Interpreter& interp;
41  TclObject command;
42  TclObject condition;
43  bool executing;
44 };
45 
46 } // namespace openmsx
47 
48 #endif
TclObject getConditionObj() const
string_ref getString() const
Definition: TclObject.cc:190
BreakPointBase(GlobalCliComm &cliComm, Interpreter &interp, TclObject command, TclObject condition)
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
Interpreter & getInterpreter() const
Base class for CPU break and watch points.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:7
Based on boost::noncopyable, see boost documentation: http://www.boost.org/libs/utility.
Definition: noncopyable.hh:12