Mercurial > octave
diff libinterp/corefcn/interpreter-private.h @ 23511:232c8d69d934
manage interpreter instance in interpreter object
Currently it is only possible to have one application or interpreter
object. Enforce that restriction.
* octave.h, octave.cc (application::the_interpreter): Delete.
(application::application): Ensure only one application is created at
once.
* interpreter.cc, interpreter.h (interpreter::instance):
New static variable.
(interpreter::interpreter): Ensure only one is created at once.
(interpreter::~interpreter): Set instance to nullptr.
(interpreter::the_interpreter): New function.
* interpreter-private.cc, interpreter-private.cc
(__get_interpreter__): Delete. Replace all uses with
octave::interpreter::the_interpreter.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 18 May 2017 10:53:24 -0400 |
parents | d24d01273bd0 |
children | 1bc8f1f50b54 |
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter-private.h Wed May 17 22:13:28 2017 -0700 +++ b/libinterp/corefcn/interpreter-private.h Thu May 18 10:53:24 2017 -0400 @@ -27,12 +27,9 @@ #include <string> -#include "interpreter.h" - namespace octave { - // Expect these functions to change without warning. - extern interpreter& __get_interpreter__ (const std::string& who); + class load_path; extern load_path& __get_load_path__ (const std::string& who); }