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