annotate libinterp/corefcn/workspace-element.h @ 20614:10ec79b47808

use new string_value method to handle value extraction errors * __voronoi__.cc, chol.cc, colamd.cc, fftw.cc: Use new string_value method.
author John W. Eaton <jwe@octave.org>
date Thu, 08 Oct 2015 18:15:56 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17824
diff changeset
3 Copyright (C) 2013-2015 John W. Eaton
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 This file is part of Octave.
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 option) any later version.
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 for more details.
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 */
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 #if !defined (octave_workspace_element_h)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 #define octave_workspace_element_h 1
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #include <string>
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 class workspace_element
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 {
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 public:
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 workspace_element (char scope_arg = 'l',
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 const std::string& symbol_arg = "<name>",
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 const std::string& class_name_arg = "<class>",
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 const std::string& value_arg = "<value>",
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
36 const std::string& dimension_arg = "<dimension>",
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
37 bool complex_flag_arg = false)
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 : xscope (scope_arg), xsymbol (symbol_arg),
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 xclass_name (class_name_arg), xvalue (value_arg),
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
40 xdimension (dimension_arg), xcomplex_flag (complex_flag_arg)
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 { }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 workspace_element (const workspace_element& ws_elt)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 : xscope (ws_elt.xscope), xsymbol (ws_elt.xsymbol),
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 xclass_name (ws_elt.xclass_name), xvalue (ws_elt.xvalue),
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
46 xdimension (ws_elt.xdimension), xcomplex_flag (ws_elt.xcomplex_flag)
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 { }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 workspace_element operator = (const workspace_element& ws_elt)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 {
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 if (this != &ws_elt)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 {
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 xscope = ws_elt.xscope;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 xsymbol = ws_elt.xsymbol;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 xclass_name = ws_elt.xclass_name;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 xvalue = ws_elt.xvalue;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 xdimension = ws_elt.xdimension;
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
58 xcomplex_flag = ws_elt.xcomplex_flag;
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 return *this;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 ~workspace_element (void) { }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 char scope (void) const { return xscope; }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 std::string symbol (void) const { return xsymbol; }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 std::string class_name (void) const { return xclass_name; }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 std::string value (void) const { return xvalue; }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 std::string dimension (void) const { return xdimension; }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
76 bool complex_flag (void) const { return xcomplex_flag; }
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
77
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 private:
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 // [g]lobal, [p]ersistent, [l]ocal
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 char xscope;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 std::string xsymbol;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 std::string xclass_name;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 std::string xvalue;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 std::string xdimension;
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 16892
diff changeset
86 bool xcomplex_flag;
16473
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 };
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 #endif