4645
|
1 /* |
|
2 |
|
3 Copyright (C) 2003 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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
4645
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_streamoff_h) |
|
25 #define octave_streamoff_h 1 |
|
26 |
|
27 #include <iostream> |
|
28 |
4646
|
29 #include "so-array.h" |
4645
|
30 #include "oct-alloc.h" |
|
31 |
4646
|
32 #include "ov.h" |
4645
|
33 #include "ov-base-mat.h" |
|
34 #include "ov-typeinfo.h" |
|
35 |
|
36 class tree_walker; |
|
37 |
|
38 // Stream offsets. |
|
39 |
|
40 class |
|
41 octave_streamoff : public octave_base_matrix<streamoff_array> |
|
42 { |
|
43 public: |
|
44 |
|
45 octave_streamoff (void) |
|
46 : octave_base_matrix<streamoff_array> () { } |
|
47 |
|
48 octave_streamoff (const std::streamoff& off) |
|
49 : octave_base_matrix<streamoff_array> |
|
50 (streamoff_array (dim_vector (1, 1), off)) { } |
|
51 |
|
52 octave_streamoff (const streamoff_array& off) |
|
53 : octave_base_matrix<streamoff_array> (off) { } |
|
54 |
|
55 octave_streamoff (const octave_streamoff& off) |
|
56 : octave_base_matrix<streamoff_array> (off) { } |
|
57 |
|
58 ~octave_streamoff (void) { } |
|
59 |
|
60 octave_value *clone (void) const { return new octave_streamoff (*this); } |
|
61 octave_value *empty_clone (void) const { return new octave_streamoff (); } |
|
62 |
|
63 bool is_defined (void) const { return true; } |
|
64 |
|
65 bool is_streamoff (void) const { return true; } |
|
66 |
|
67 std::streamoff streamoff_value (void) const; |
|
68 |
|
69 streamoff_array streamoff_array_value (void) const { return matrix; } |
|
70 |
4646
|
71 void increment (void) { matrix += std::streamoff (1); } |
4645
|
72 |
4646
|
73 void decrement (void) { matrix -= std::streamoff (1); } |
4645
|
74 |
|
75 bool print_as_scalar (void) const { return true; } |
|
76 |
|
77 void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
78 |
|
79 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
80 |
|
81 private: |
|
82 |
|
83 DECLARE_OCTAVE_ALLOCATOR |
|
84 |
|
85 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
|
86 }; |
|
87 |
|
88 #endif |
|
89 |
|
90 /* |
|
91 ;;; Local Variables: *** |
|
92 ;;; mode: C++ *** |
|
93 ;;; End: *** |
|
94 */ |