3353
|
1 /* |
|
2 |
|
3 Copyright (C) 1999 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_cell_h) |
|
24 #define octave_cell_h 1 |
|
25 |
4066
|
26 #if defined (__GNUG__) && ! defined (NO_PRAGMA_INTERFACE_IMPLEMENTATION) |
3353
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cstdlib> |
|
31 |
3503
|
32 #include <iostream> |
3353
|
33 #include <string> |
|
34 |
|
35 #include "mx-base.h" |
|
36 #include "oct-alloc.h" |
|
37 #include "str-vec.h" |
|
38 |
|
39 #include "Cell.h" |
|
40 #include "error.h" |
3928
|
41 #include "ov-base-mat.h" |
3353
|
42 #include "ov-typeinfo.h" |
|
43 |
|
44 class Octave_map; |
|
45 class octave_value_list; |
|
46 |
|
47 class tree_walker; |
|
48 |
|
49 // Cells. |
|
50 |
|
51 class |
3928
|
52 octave_cell : public octave_base_matrix<Cell> |
3353
|
53 { |
|
54 public: |
|
55 |
|
56 octave_cell (void) |
3928
|
57 : octave_base_matrix<Cell> () { } |
3353
|
58 |
|
59 octave_cell (const Cell& c) |
3928
|
60 : octave_base_matrix<Cell> (c) { } |
3353
|
61 |
|
62 octave_cell (const octave_cell& c) |
3928
|
63 : octave_base_matrix<Cell> (c) { } |
3353
|
64 |
|
65 ~octave_cell (void) { } |
|
66 |
|
67 void assign (const octave_value_list& idx, const octave_value& rhs); |
|
68 |
3933
|
69 octave_value *clone (void) const { return new octave_cell (*this); } |
|
70 octave_value *empty_clone (void) const { return new octave_cell (); } |
3353
|
71 |
3928
|
72 #if 0 |
|
73 octave_value *try_narrowing_conversion (void); |
|
74 #endif |
|
75 |
3933
|
76 octave_value subsref (const std::string type, |
|
77 const SLList<octave_value_list>& idx); |
|
78 |
|
79 octave_value subsasgn (const std::string type, |
|
80 const SLList<octave_value_list>& idx, |
|
81 const octave_value& rhs); |
|
82 |
3928
|
83 bool is_defined (void) const { return true; } |
3353
|
84 |
3724
|
85 bool is_cell (void) const { return true; } |
|
86 |
3928
|
87 Cell cell_value (void) const { return matrix; } |
3353
|
88 |
3933
|
89 octave_value_list list_value (void) const; |
|
90 |
|
91 void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
92 |
|
93 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
94 |
|
95 bool print_name_tag (std::ostream& os, const std::string& name) const; |
|
96 |
3353
|
97 private: |
|
98 DECLARE_OCTAVE_ALLOCATOR |
|
99 |
|
100 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
|
101 }; |
|
102 |
|
103 #endif |
|
104 |
|
105 /* |
|
106 ;;; Local Variables: *** |
|
107 ;;; mode: C++ *** |
|
108 ;;; End: *** |
|
109 */ |