3978
|
1 /* |
|
2 |
|
3 Copyright (C) 2002 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 2, or (at your option) any |
|
10 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, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_cs_list_h) |
|
24 #define octave_cs_list_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
3978
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cstdlib> |
|
31 |
|
32 #include <iostream> |
|
33 #include <string> |
|
34 |
|
35 #include "mx-base.h" |
|
36 #include "str-vec.h" |
|
37 |
4591
|
38 #include "Cell.h" |
3978
|
39 #include "error.h" |
|
40 #include "oct-alloc.h" |
|
41 #include "oct-obj.h" |
|
42 #include "ov-list.h" |
|
43 #include "ov-typeinfo.h" |
|
44 |
|
45 class tree_walker; |
|
46 |
|
47 // Lists. |
|
48 |
|
49 class |
4591
|
50 octave_cs_list : public octave_base_value |
3978
|
51 { |
|
52 public: |
|
53 |
|
54 octave_cs_list (void) |
4591
|
55 : lst () { } |
3978
|
56 |
|
57 octave_cs_list (const octave_value_list& l) |
4591
|
58 : lst (l) { } |
3978
|
59 |
4591
|
60 octave_cs_list (const Cell& c); |
4513
|
61 |
3978
|
62 octave_cs_list (const octave_cs_list& l) |
4591
|
63 : lst (l) { } |
3978
|
64 |
|
65 ~octave_cs_list (void) { } |
|
66 |
|
67 octave_value *clone (void) const { return new octave_cs_list (*this); } |
|
68 octave_value *empty_clone (void) const { return new octave_cs_list (); } |
|
69 |
4591
|
70 dim_vector dims (void) const { return dim_vector (1, lst.length ()); } |
3978
|
71 |
|
72 bool is_defined (void) const { return true; } |
|
73 |
|
74 bool is_constant (void) const { return true; } |
|
75 |
|
76 bool is_cs_list (void) const { return true; } |
|
77 |
|
78 octave_value_list list_value (void) const { return lst; } |
|
79 |
4604
|
80 void print (std::ostream& os, bool) const; |
|
81 |
3978
|
82 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
83 |
4591
|
84 private: |
4499
|
85 |
4591
|
86 // The list of Octave values. |
|
87 octave_value_list lst; |
3978
|
88 |
|
89 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
|
90 |
|
91 DECLARE_OCTAVE_ALLOCATOR |
|
92 }; |
|
93 |
|
94 #endif |
|
95 |
|
96 /* |
|
97 ;;; Local Variables: *** |
|
98 ;;; mode: C++ *** |
|
99 ;;; End: *** |
|
100 */ |