Mercurial > hg > octave-nkf
annotate libinterp/interp-core/oct-lvalue.h @ 15195:2fc554ffbc28
split libinterp from src
* libinterp: New directory. Move all files from src directory here
except Makefile.am, main.cc, main-cli.cc, mkoctfile.in.cc,
mkoctfilr.in.sh, octave-config.in.cc, octave-config.in.sh.
* libinterp/Makefile.am: New file, extracted from src/Makefile.am.
* src/Makefile.am: Delete everything except targets and definitions
needed to build and link main and utility programs.
* Makefile.am (SUBDIRS): Include libinterp in the list.
* autogen.sh: Run config-module.sh in libinterp/dldfcn directory, not
src/dldfcn directory.
* configure.ac (AC_CONFIG_SRCDIR): Use libinterp/octave.cc, not
src/octave.cc.
(DL_LDFLAGS, LIBOCTINTERP): Use libinterp, not src.
(AC_CONFIG_FILES): Include libinterp/Makefile in the list.
* find-docstring-files.sh: Look in libinterp, not src.
* gui/src/Makefile.am (liboctgui_la_CPPFLAGS): Find header files in
libinterp, not src.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 18 Aug 2012 16:23:39 -0400 |
parents | src/interp-core/oct-lvalue.h@909a2797935b |
children | 302157614308 |
rev | line source |
---|---|
2979 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
3 Copyright (C) 1996-2012 John W. Eaton |
2979 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2979 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2979 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_lvalue_h) | |
24 #define octave_lvalue_h 1 | |
25 | |
26 class octave_value; | |
27 class octave_value_list; | |
28 | |
29 #include <string> | |
30 | |
31 #include "oct-obj.h" | |
3929 | 32 #include "pt-idx.h" |
2979 | 33 |
34 class | |
35 octave_lvalue | |
36 { | |
37 public: | |
38 | |
10206
37a08e0ce2dc
support Matlab-style empty output/input arguments
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
39 octave_lvalue (octave_value *v = 0) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
40 : val (v), type (), idx (), nel (1) |
10227
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
41 { } |
2979 | 42 |
43 octave_lvalue (const octave_lvalue& vr) | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
44 : val (vr.val), type (vr.type), idx (vr.idx), nel (vr.nel) |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 { |
10206
37a08e0ce2dc
support Matlab-style empty output/input arguments
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
46 } |
2979 | 47 |
48 octave_lvalue& operator = (const octave_lvalue& vr) | |
49 { | |
50 if (this != &vr) | |
10313 | 51 { |
52 val = vr.val; | |
53 type = vr.type; | |
54 idx = vr.idx; | |
55 nel = vr.nel; | |
56 } | |
2979 | 57 |
58 return *this; | |
59 } | |
60 | |
61 ~octave_lvalue (void) { } | |
62 | |
10227
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
63 bool is_black_hole (void) const { return val == 0; } |
10206
37a08e0ce2dc
support Matlab-style empty output/input arguments
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
64 |
10227
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
65 bool is_defined (void) const { return val && val->is_defined (); } |
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
66 |
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
67 bool is_undefined (void) const { return ! val || val->is_undefined (); } |
2979 | 68 |
10227
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
69 bool is_map (void) const { return val && val->is_map (); } |
2979 | 70 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
71 void define (const octave_value& v) |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
72 { |
10227
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
73 if (val) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
74 *val = v; |
10227
d3fc22c3071c
omit ~ values from multi-assignment return lists
Jaroslav Hajek <highegg@gmail.com>
parents:
10206
diff
changeset
|
75 } |
2979 | 76 |
77 void assign (octave_value::assign_op, const octave_value&); | |
78 | |
5846 | 79 void numel (octave_idx_type n) { nel = n; } |
80 | |
81 octave_idx_type numel (void) const { return nel; } | |
82 | |
4219 | 83 void set_index (const std::string& t, const std::list<octave_value_list>& i); |
2979 | 84 |
3933 | 85 void clear_index (void) { type = std::string (); idx.clear (); } |
2984 | 86 |
3203 | 87 void do_unary_op (octave_value::unary_op op); |
2979 | 88 |
5001 | 89 octave_value value (void); |
2979 | 90 |
4234 | 91 const octave_value *object (void) const { return val; } |
92 | |
2979 | 93 private: |
94 | |
95 octave_value *val; | |
96 | |
3933 | 97 std::string type; |
2979 | 98 |
4219 | 99 std::list<octave_value_list> idx; |
3929 | 100 |
5846 | 101 octave_idx_type nel; |
2979 | 102 }; |
103 | |
104 #endif |