annotate libinterp/interpfcn/workspace-element.h @ 16473:e16f209ed05b

* workspace-element.h: Commit file missing from previous change.
author John W. Eaton <jwe@octave.org>
date Mon, 08 Apr 2013 19:10:23 -0400
parents
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
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 Copyright (C) 2013 John W. Eaton
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>",
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 const std::string& dimension_arg = "<dimension>")
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 : 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
38 xclass_name (class_name_arg), xvalue (value_arg),
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 xdimension (dimension_arg)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 { }
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 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
43 : 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
44 xclass_name (ws_elt.xclass_name), xvalue (ws_elt.xvalue),
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 xdimension (ws_elt.xdimension)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 { }
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 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
49 {
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 if (this != &ws_elt)
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 {
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 xscope = ws_elt.xscope;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 xsymbol = ws_elt.xsymbol;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 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
55 xvalue = ws_elt.xvalue;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 xdimension = ws_elt.xdimension;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 }
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 return *this;
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
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 ~workspace_element (void) { }
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 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
65
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 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
67
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 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
69
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 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
71
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 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
73
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 private:
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 // [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
77 char xscope;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 std::string xsymbol;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 std::string xclass_name;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 std::string xvalue;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 std::string xdimension;
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 };
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83
e16f209ed05b * workspace-element.h: Commit file missing from previous change.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 #endif