4645
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 2003, 2004, 2005, 2006, 2007 John W. Eaton |
4645
|
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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
4645
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
4645
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_streamoff_h) |
|
24 #define octave_streamoff_h 1 |
|
25 |
|
26 #include <iostream> |
|
27 |
4646
|
28 #include "so-array.h" |
4645
|
29 #include "oct-alloc.h" |
|
30 |
4646
|
31 #include "ov.h" |
4645
|
32 #include "ov-base-mat.h" |
|
33 #include "ov-typeinfo.h" |
|
34 |
|
35 class tree_walker; |
|
36 |
|
37 // Stream offsets. |
|
38 |
|
39 class |
|
40 octave_streamoff : public octave_base_matrix<streamoff_array> |
|
41 { |
|
42 public: |
|
43 |
|
44 octave_streamoff (void) |
|
45 : octave_base_matrix<streamoff_array> () { } |
|
46 |
|
47 octave_streamoff (const std::streamoff& off) |
|
48 : octave_base_matrix<streamoff_array> |
|
49 (streamoff_array (dim_vector (1, 1), off)) { } |
|
50 |
|
51 octave_streamoff (const streamoff_array& off) |
|
52 : octave_base_matrix<streamoff_array> (off) { } |
|
53 |
|
54 octave_streamoff (const octave_streamoff& off) |
|
55 : octave_base_matrix<streamoff_array> (off) { } |
|
56 |
|
57 ~octave_streamoff (void) { } |
|
58 |
5759
|
59 octave_base_value *clone (void) const { return new octave_streamoff (*this); } |
|
60 octave_base_value *empty_clone (void) const { return new octave_streamoff (); } |
4645
|
61 |
|
62 bool is_defined (void) const { return true; } |
|
63 |
|
64 bool is_streamoff (void) const { return true; } |
|
65 |
|
66 std::streamoff streamoff_value (void) const; |
|
67 |
|
68 streamoff_array streamoff_array_value (void) const { return matrix; } |
|
69 |
4646
|
70 void increment (void) { matrix += std::streamoff (1); } |
4645
|
71 |
4646
|
72 void decrement (void) { matrix -= std::streamoff (1); } |
4645
|
73 |
|
74 bool print_as_scalar (void) const { return true; } |
|
75 |
|
76 void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
77 |
|
78 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
79 |
7433
|
80 octave_value sort (octave_idx_type, sortmode) const |
|
81 { |
|
82 gripe_wrong_type_arg ("octave_base_value::sort ()", type_name ()); |
|
83 return octave_value(); |
|
84 } |
|
85 octave_value sort (Array<octave_idx_type> &, octave_idx_type, |
|
86 sortmode) const |
|
87 { |
|
88 gripe_wrong_type_arg ("octave_base_value::sort ()", type_name ()); |
|
89 return octave_value(); |
|
90 } |
|
91 |
4645
|
92 private: |
|
93 |
|
94 DECLARE_OCTAVE_ALLOCATOR |
|
95 |
|
96 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
|
97 }; |
|
98 |
|
99 #endif |
|
100 |
|
101 /* |
|
102 ;;; Local Variables: *** |
|
103 ;;; mode: C++ *** |
|
104 ;;; End: *** |
|
105 */ |