3978
|
1 /* |
|
2 |
8920
|
3 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 John W. Eaton |
3978
|
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. |
3978
|
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/>. |
3978
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_cs_list_h) |
|
24 #define octave_cs_list_h 1 |
|
25 |
|
26 #include <cstdlib> |
|
27 |
|
28 #include <iostream> |
|
29 #include <string> |
|
30 |
|
31 #include "mx-base.h" |
|
32 #include "str-vec.h" |
|
33 |
4591
|
34 #include "Cell.h" |
3978
|
35 #include "error.h" |
|
36 #include "oct-alloc.h" |
|
37 #include "oct-obj.h" |
|
38 #include "ov-list.h" |
|
39 #include "ov-typeinfo.h" |
|
40 |
|
41 class tree_walker; |
|
42 |
|
43 // Lists. |
|
44 |
|
45 class |
4591
|
46 octave_cs_list : public octave_base_value |
3978
|
47 { |
|
48 public: |
|
49 |
|
50 octave_cs_list (void) |
4664
|
51 : octave_base_value (), lst () { } |
3978
|
52 |
|
53 octave_cs_list (const octave_value_list& l) |
4664
|
54 : octave_base_value (), lst (l) { } |
3978
|
55 |
4591
|
56 octave_cs_list (const Cell& c); |
4513
|
57 |
3978
|
58 octave_cs_list (const octave_cs_list& l) |
5759
|
59 : octave_base_value (), lst (l.lst) { } |
3978
|
60 |
|
61 ~octave_cs_list (void) { } |
|
62 |
5759
|
63 octave_base_value *clone (void) const { return new octave_cs_list (*this); } |
|
64 octave_base_value *empty_clone (void) const { return new octave_cs_list (); } |
3978
|
65 |
4591
|
66 dim_vector dims (void) const { return dim_vector (1, lst.length ()); } |
3978
|
67 |
|
68 bool is_defined (void) const { return true; } |
|
69 |
|
70 bool is_constant (void) const { return true; } |
|
71 |
|
72 bool is_cs_list (void) const { return true; } |
|
73 |
|
74 octave_value_list list_value (void) const { return lst; } |
|
75 |
4591
|
76 private: |
4499
|
77 |
4591
|
78 // The list of Octave values. |
|
79 octave_value_list lst; |
3978
|
80 |
4612
|
81 DECLARE_OCTAVE_ALLOCATOR |
3978
|
82 |
4612
|
83 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
3978
|
84 }; |
|
85 |
|
86 #endif |
|
87 |
|
88 /* |
|
89 ;;; Local Variables: *** |
|
90 ;;; mode: C++ *** |
|
91 ;;; End: *** |
|
92 */ |