diff libinterp/parse-tree/bp-table.h @ 25347:af3319d86a5f

eliminate some global references to interpreter internals * bp-table.h, bp-table.cc (bp_table::m_interpreter): New data member. (get_user_code): Deprecate. * interpreter.h, interpreter.cc (interpreter::get_user_code): New function. Change all uses of global get_uesr_code to use interpreter::get_user_code instead.
author John W. Eaton <jwe@octave.org>
date Thu, 03 May 2018 16:04:53 -0400
parents 6652d3823428
children bc5f225bc578
line wrap: on
line diff
--- a/libinterp/parse-tree/bp-table.h	Thu May 03 02:26:29 2018 -0400
+++ b/libinterp/parse-tree/bp-table.h	Thu May 03 16:04:53 2018 -0400
@@ -36,6 +36,8 @@
 
 namespace octave
 {
+  class interpreter;
+
   struct bp_type
   {
     int line;
@@ -49,9 +51,9 @@
   {
   public:
 
-    bp_table (void)
-      : m_bp_set (), m_errors_that_stop (), m_caught_that_stop (),
-        m_warnings_that_stop ()
+    bp_table (interpreter& interp)
+      : m_interpreter (interp), m_bp_set (), m_errors_that_stop (),
+        m_caught_that_stop (), m_warnings_that_stop ()
     { }
 
     ~bp_table (void) = default;
@@ -128,6 +130,8 @@
     typedef std::set<std::string>::const_iterator const_bp_set_iterator;
     typedef std::set<std::string>::iterator bp_set_iterator;
 
+    interpreter& m_interpreter;
+
     // Set of function (.m file) names containing at least one breakpoint.
     std::set<std::string> m_bp_set;
 
@@ -149,6 +153,7 @@
                                              const std::string& fname);
   };
 
+  OCTAVE_DEPRECATED (5, "use 'octave::get_user_code' instead")
   extern octave_user_code * get_user_code (const std::string& fname = "");
 }