GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
workspace-element.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_workspace_element_h)
24 #define octave_workspace_element_h 1
25 
26 #include <string>
27 
29 {
30 public:
31 
32  workspace_element (char scope_arg = 'l',
33  const std::string& symbol_arg = "<name>",
34  const std::string& class_name_arg = "<class>",
35  const std::string& value_arg = "<value>",
36  const std::string& dimension_arg = "<dimension>",
37  bool complex_flag_arg = false)
38  : xscope (scope_arg), xsymbol (symbol_arg),
39  xclass_name (class_name_arg), xvalue (value_arg),
40  xdimension (dimension_arg), xcomplex_flag (complex_flag_arg)
41  { }
42 
44  : xscope (ws_elt.xscope), xsymbol (ws_elt.xsymbol),
45  xclass_name (ws_elt.xclass_name), xvalue (ws_elt.xvalue),
47  { }
48 
50  {
51  if (this != &ws_elt)
52  {
53  xscope = ws_elt.xscope;
54  xsymbol = ws_elt.xsymbol;
55  xclass_name = ws_elt.xclass_name;
56  xvalue = ws_elt.xvalue;
57  xdimension = ws_elt.xdimension;
59  }
60 
61  return *this;
62  }
63 
64  ~workspace_element (void) { }
65 
66  char scope (void) const { return xscope; }
67 
68  std::string symbol (void) const { return xsymbol; }
69 
70  std::string class_name (void) const { return xclass_name; }
71 
72  std::string value (void) const { return xvalue; }
73 
74  std::string dimension (void) const { return xdimension; }
75 
76  bool complex_flag (void) const { return xcomplex_flag; }
77 
78 private:
79 
80  // [g]lobal, [p]ersistent, [l]ocal
81  char xscope;
82  std::string xsymbol;
83  std::string xclass_name;
84  std::string xvalue;
85  std::string xdimension;
87 };
88 
89 #endif