GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-lvalue.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2018 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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_oct_lvalue_h)
24 #define octave_oct_lvalue_h 1
25 
26 #include "octave-config.h"
27 
28 #include <string>
29 
30 #include "ovl.h"
31 #include "symrec.h"
32 
33 namespace octave
34 {
36  {
37  public:
38 
40  : m_sym (), m_context (0), m_black_hole (false), m_type (),
41  m_idx (), m_nel (1)
42  { }
43 
46  m_type (), m_idx (), m_nel (1)
47  { }
48 
49  octave_lvalue (const octave_lvalue&) = default;
50 
51  octave_lvalue& operator = (const octave_lvalue&) = default;
52 
53  ~octave_lvalue (void) = default;
54 
55  bool is_black_hole (void) const { return m_black_hole; }
56 
57  void mark_black_hole (void) { m_black_hole = true; }
58 
59  bool is_defined (void) const
60  {
61  return ! is_black_hole () && m_sym.is_defined (m_context);
62  }
63 
64  bool is_undefined (void) const
65  {
67  }
68 
69  bool isstruct (void) const { return value().isstruct (); }
70 
71  void define (const octave_value& v) { m_sym.assign (v, m_context); }
72 
74 
75  void numel (octave_idx_type n) { m_nel = n; }
76 
77  octave_idx_type numel (void) const { return m_nel; }
78 
79  void set_index (const std::string& t, const std::list<octave_value_list>& i);
80 
81  void clear_index (void) { m_type = ""; m_idx.clear (); }
82 
83  std::string index_type (void) const { return m_type; }
84 
85  bool index_is_empty (void) const;
86 
88 
89  octave_value value (void) const;
90 
91  private:
92 
94 
96 
98 
100 
101  std::list<octave_value_list> m_idx;
102 
104  };
105 }
106 
107 #endif
bool isstruct(void) const
Definition: oct-lvalue.h:69
void do_unary_op(octave_value::unary_op op)
Definition: oct-lvalue.cc:70
assign_op
Definition: ov.h:136
octave_lvalue & operator=(const octave_lvalue &)=default
bool is_undefined(context_id context) const
Definition: symrec.h:640
void assign(const octave_value &value, context_id context)
Definition: symrec.h:592
~octave_lvalue(void)=default
bool is_undefined(void) const
Definition: oct-lvalue.h:64
void define(const octave_value &v)
Definition: oct-lvalue.h:71
std::string m_type
Definition: oct-lvalue.h:99
std::string index_type(void) const
Definition: oct-lvalue.h:83
std::list< octave_value_list > m_idx
Definition: oct-lvalue.h:101
static llvm::LLVMContext & context
Definition: jit-typeinfo.cc:79
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:997
octave_value value(void) const
Definition: oct-lvalue.cc:81
symbol_record::context_id m_context
Definition: oct-lvalue.h:95
symbol_record m_sym
Definition: oct-lvalue.h:93
octave_lvalue(const symbol_record &sr, symbol_record::context_id context)
Definition: oct-lvalue.h:44
void assign(octave_value::assign_op, const octave_value &)
Definition: oct-lvalue.cc:34
is false
Definition: cellfun.cc:400
octave_idx_type m_nel
Definition: oct-lvalue.h:103
bool isstruct(void) const
Definition: ov.h:589
octave_idx_type numel(void) const
Definition: oct-lvalue.h:77
void numel(octave_idx_type n)
Definition: oct-lvalue.h:75
bool index_is_empty(void) const
Definition: oct-lvalue.cc:56
void mark_black_hole(void)
Definition: oct-lvalue.h:57
void set_index(const std::string &t, const std::list< octave_value_list > &i)
Definition: oct-lvalue.cc:46
bool is_defined(context_id context) const
Definition: symrec.h:635
void clear_index(void)
Definition: oct-lvalue.h:81
bool is_defined(void) const
Definition: oct-lvalue.h:59
for i
Definition: data.cc:5264
unary_op
Definition: ov.h:81
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:888
bool is_black_hole(void) const
Definition: oct-lvalue.h:55