diff libinterp/corefcn/symscope.h @ 24362:3fc24b792a24

avoid including symtab.h, symscope.h, or symrec.h unnecessarily * main-window.cc, workspace-view.cc, call-stack.cc, call-stack.h, defun-int.h, input.cc, load-save.h, symscope.h, symtab.h, variables.h, ov-fcn-inline.h, ov-fcn.h, ov-usr-fcn.cc, ov-usr-fcn.h, lex.h, oct-lvalue.h, parse.h, pt-arg-list.h, pt-array-list.h, pt-assign.h, pt-binop.h, pt-cbinop.h, pt-cell.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.h, pt-eval.h, pt-except.h, pt-exp.h, pt-fcn-handle.h, pt-idx.h, pt-jit.h, pt-jump.h, pt-loop.h, pt-mat.h, pt-misc.h, pt-select.h, pt-stmt.h, pt-unop.h, token.cc, token.h: Where possible, use forward declarations for symbol_table, symbol_scope, and symbol_record. Don't include symtab.h, symscope.h, or symrec.h unless needed. Use symbol_record::context_id instead of symbol_table::context_id or symbol_scope::context_id. Delete typedefs for symbol_table::context_id and symbol_scope::context_id.
author John W. Eaton <jwe@octave.org>
date Tue, 05 Dec 2017 17:09:24 -0500
parents 8bcfddad15ec
children ea3458c1d884
line wrap: on
line diff
--- a/libinterp/corefcn/symscope.h	Mon Nov 27 01:12:05 2017 -0500
+++ b/libinterp/corefcn/symscope.h	Tue Dec 05 17:09:24 2017 -0500
@@ -54,8 +54,6 @@
   {
   public:
 
-    typedef symbol_record::context_id context_id;
-
     typedef std::map<std::string, symbol_record>::const_iterator
     table_const_iterator;
     typedef std::map<std::string, symbol_record>::iterator
@@ -111,9 +109,15 @@
       return new_sid;
     }
 
-    void set_context (context_id context) { m_context = context; }
+    void set_context (symbol_record::context_id context)
+    {
+      m_context = context;
+    }
 
-    context_id current_context (void) const { return m_context; }
+    symbol_record::context_id current_context (void) const
+    {
+      return m_context;
+    }
 
     symbol_record find_symbol (const std::string& name)
     {
@@ -551,15 +555,13 @@
     // If true then no variables can be added.
     bool m_is_static;
 
-    context_id m_context;
+    symbol_record::context_id m_context;
   };
 
   class symbol_scope
   {
   public:
 
-    typedef symbol_record::context_id context_id;
-
     symbol_scope (const std::string& name = "")
       : m_rep (new symbol_scope_rep (name))
     { }
@@ -614,12 +616,12 @@
       return symbol_scope (m_rep->dup ());
     }
 
-    void set_context (context_id context)
+    void set_context (symbol_record::context_id context)
     {
       m_rep->set_context (context);
     }
 
-    context_id current_context (void) const
+    symbol_record::context_id current_context (void) const
     {
       return m_rep->current_context ();
     }