Mercurial > octave
annotate libinterp/octave-value/ov-oncleanup.h @ 21739:c4ab2e54f100
use namespace for oct_mach_info class
* mach-info.h, mach-info.cc: Put oct_mach_info in octave namespace and
rename to mach_info. Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 May 2016 01:59:35 -0400 |
parents | 1473547f50f5 |
children | bac0d6f07a3e |
rev | line source |
---|---|
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
18416
diff
changeset
|
3 Copyright (C) 2010-2015 VZLU Prague |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 option) any later version. |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 for more details. |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
21213
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
23 #if ! defined (octave_ov_oncleanup_h) |
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
24 #define octave_ov_oncleanup_h 1 |
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21213
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21213
diff
changeset
|
27 |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #include <iosfwd> |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include "ov-base.h" |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include "ov-struct.h" |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 #include "ov.h" |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 class octave_oncleanup : public octave_base_value |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 { |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 public: |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 octave_oncleanup (void) : fcn () { } |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 octave_oncleanup (const octave_value& fcn); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 octave_base_value *clone (void) const |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 { |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 if (fcn.is_defined ()) |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
20265
diff
changeset
|
45 error ("onCleanup: internal error: cloning nonempty object"); |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 return empty_clone (); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 } |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 octave_base_value *empty_clone (void) const |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 { |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 return new octave_oncleanup (); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 } |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 ~octave_oncleanup (void); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 bool is_defined (void) const { return true; } |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 bool is_object (void) const { return true; } // do we want this? |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 octave_map map_value (void) const { return scalar_map_value (); } |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 octave_scalar_map scalar_map_value (void) const; |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 dim_vector dims (void) const |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 { |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 static dim_vector dv (1, 1); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 return dv; |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 } |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 bool save_ascii (std::ostream& os); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 bool load_ascii (std::istream& is); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 bool save_binary (std::ostream& os, bool& save_as_floats); |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 bool load_binary (std::istream& is, bool swap, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
78 octave::mach_info::float_format fmt); |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
80 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
82 bool load_hdf5 (octave_hdf5_id loc_id, const char *name); |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 |
18416
bcd71a2531d3
Support disp/display overloading in classdef
Michael Goffioul <michael.goffioul@gmail.com>
parents:
17744
diff
changeset
|
84 void print (std::ostream& os, bool pr_as_read_syntax = false); |
14013
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
88 private: |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
92 protected: |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
93 |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
94 octave_value fcn; |
1734ebe27134
move onCleanup function and class to liboctinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
95 }; |
21213
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
96 |
f7d1050b9b53
maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
97 #endif |