498
|
1 // oct-obj.h -*- C -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993, 1994 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
504
|
24 #if !defined (octave_oct_obj_h) |
|
25 #define octave_oct_obj_h 1 |
|
26 |
498
|
27 #include "Array.h" |
|
28 |
|
29 class tree_constant; |
|
30 |
508
|
31 class Octave_object : public Array<tree_constant> |
|
32 { |
|
33 public: |
|
34 |
|
35 Octave_object (void) : Array<tree_constant> () { } |
|
36 Octave_object (int n) : Array<tree_constant> (n) { } |
511
|
37 Octave_object (int n, const tree_constant& val) |
|
38 : Array<tree_constant> (n, val) { } |
|
39 |
508
|
40 Octave_object (const Octave_object& obj) : Array<tree_constant> (obj) { } |
|
41 |
|
42 Octave_object& operator = (const Octave_object& obj) |
|
43 { |
|
44 Array<tree_constant>::operator = (obj); |
|
45 return *this; |
|
46 } |
|
47 |
|
48 #if 0 |
|
49 // For now, translate the index, since it will be somewhat difficult |
|
50 // to fix this without some major (and relatively risky) surgery. |
|
51 |
|
52 tree_constant& elem (int n) |
|
53 { return Array<tree_constant>::elem (n - 1); } |
|
54 |
|
55 tree_constant& checkelem (int n); |
|
56 { return Array<tree_constant>::checkelem (n - 1); } |
|
57 |
|
58 tree_constant& operator () (int n); |
|
59 { return Array<tree_constant>::operator () (n - 1); } |
|
60 |
|
61 // No checking. |
|
62 tree_constant& xelem (int n); |
|
63 { return Array<tree_constant>::xelem (n - 1); } |
|
64 |
|
65 tree_constant elem (int n) const; |
|
66 { return Array<tree_constant>::elem (n - 1); } |
|
67 |
|
68 tree_constant checkelem (int n) const; |
|
69 { return Array<tree_constant>::checkelem (n - 1); } |
|
70 |
|
71 tree_constant operator () (int n) const; |
|
72 { return Array<tree_constant>::operator () (n - 1); } |
|
73 #endif |
|
74 }; |
498
|
75 |
504
|
76 #endif |
|
77 |
498
|
78 /* |
|
79 ;;; Local Variables: *** |
|
80 ;;; mode: C++ *** |
|
81 ;;; page-delimiter: "^/\\*" *** |
|
82 ;;; End: *** |
|
83 */ |