GNU Octave  4.2.1
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-2017 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 "octave-config.h"
27 
28 #include <string>
29 
31 {
32 public:
33 
34  workspace_element (char scope_arg = 'l',
35  const std::string& symbol_arg = "<name>",
36  const std::string& class_name_arg = "<class>",
37  const std::string& value_arg = "<value>",
38  const std::string& dimension_arg = "<dimension>",
39  bool complex_flag_arg = false)
40  : xscope (scope_arg), xsymbol (symbol_arg),
41  xclass_name (class_name_arg), xvalue (value_arg),
42  xdimension (dimension_arg), xcomplex_flag (complex_flag_arg)
43  { }
44 
46  : xscope (ws_elt.xscope), xsymbol (ws_elt.xsymbol),
47  xclass_name (ws_elt.xclass_name), xvalue (ws_elt.xvalue),
49  { }
50 
52  {
53  if (this != &ws_elt)
54  {
55  xscope = ws_elt.xscope;
56  xsymbol = ws_elt.xsymbol;
57  xclass_name = ws_elt.xclass_name;
58  xvalue = ws_elt.xvalue;
59  xdimension = ws_elt.xdimension;
61  }
62 
63  return *this;
64  }
65 
66  ~workspace_element (void) { }
67 
68  char scope (void) const { return xscope; }
69 
70  std::string symbol (void) const { return xsymbol; }
71 
72  std::string class_name (void) const { return xclass_name; }
73 
74  std::string value (void) const { return xvalue; }
75 
76  std::string dimension (void) const { return xdimension; }
77 
78  bool complex_flag (void) const { return xcomplex_flag; }
79 
80 private:
81 
82  // [g]lobal, [p]ersistent, [l]ocal
83  char xscope;
89 };
90 
91 #endif
std::string dimension(void) const
workspace_element operator=(const workspace_element &ws_elt)
bool complex_flag(void) const
std::string value(void) const
std::string xdimension
char scope(void) const
std::string symbol(void) const
std::string class_name(void) const
std::string xclass_name
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
workspace_element(char scope_arg= 'l', const std::string &symbol_arg="<name>", const std::string &class_name_arg="<class>", const std::string &value_arg="<value>", const std::string &dimension_arg="<dimension>", bool complex_flag_arg=false)
workspace_element(const workspace_element &ws_elt)