annotate src/ov-fcn-inline.h @ 5018:1c65a8e44ef9 ss-2-1-59

[project @ 2004-09-22 03:33:29 by jwe]
author jwe
date Wed, 22 Sep 2004 03:33:29 +0000
parents 724675f7f7cb
children e35b034d3523
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
1 /*
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
2
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 2004 David Bateman
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
4
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify it
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
6 under the terms of the GNU General Public License as published by
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
8 any later version.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
9
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
10 This program is distributed in the hope that it will be useful, but
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
11 WITHOUT ANY WARRANTY; without even the implied warranty of
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
13 General Public License for more details.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
14
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
16 along with Octave; see the file COPYING. If not, write to the Free
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
17 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
18 02111-1307, USA.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
19
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
20 In addition to the terms of the GPL, you are permitted to link
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
21 this program with any Open Source program, as defined by the
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
22 Open Source Initiative (www.opensource.org)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
23
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
24 */
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
25
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
26 #if !defined (octave_fcn_inline_h)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
27 #define octave_fcn_inline_h 1
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
28
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
29 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
30 #pragma interface
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
31 #endif
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
32
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
33 #include <iostream>
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
34 #include <string>
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
35
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
36 #include "oct-alloc.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
37
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
38 #include "ov-base.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
39 #include "ov-base-mat.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
40 #include "ov-fcn.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
41 #include "ov-typeinfo.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
42 #include "symtab.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
43 #include "ov-fcn-handle.h"
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
44
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
45 // Inline functions.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
46
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
47 class
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
48 octave_fcn_inline : public octave_fcn_handle
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
49 {
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
50 public:
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
51
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
52 octave_fcn_inline (void)
4967
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
53 : octave_fcn_handle (), iftext (), ifargs () { }
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
54
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
55 octave_fcn_inline (const std::string& f, const string_vector& a,
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
56 const std::string& n = std::string ());
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
57
4967
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
58 octave_fcn_inline (const octave_fcn_inline& fi)
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
59 : octave_fcn_handle (fi), iftext (fi.iftext), ifargs (fi.ifargs) { }
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
60
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
61 ~octave_fcn_inline (void) { }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
62
4967
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
63 octave_value *clone (void) const { return new octave_fcn_inline (*this); }
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
64 octave_value *empty_clone (void) const { return new octave_fcn_inline (); }
0355f2f7d193 [project @ 2004-09-07 15:09:14 by jwe]
jwe
parents: 4954
diff changeset
65
4954
ed0f3cb6d3d4 [project @ 2004-09-01 21:24:53 by jwe]
jwe
parents: 4933
diff changeset
66 bool is_inline_function (void) const { return true; }
ed0f3cb6d3d4 [project @ 2004-09-01 21:24:53 by jwe]
jwe
parents: 4933
diff changeset
67
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
68 octave_fcn_inline *fcn_inline_value (bool = false) { return this; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
69
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
70 std::string fcn_text (void) const { return iftext; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
71
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
72 string_vector fcn_arg_names (void) const { return ifargs; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
73
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
74 octave_value convert_to_str_internal (bool, bool) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
75
4972
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
76 bool save_ascii (std::ostream& os, bool& infnan_warned,
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
77 bool strip_nan_and_inf);
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
78
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
79 bool load_ascii (std::istream& is);
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
80
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
81 bool save_binary (std::ostream& os, bool& save_as_floats);
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
82
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
83 bool load_binary (std::istream& is, bool swap,
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
84 oct_mach_info::float_format fmt);
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
85
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
86 #if defined (HAVE_HDF5)
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
87 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats);
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
88
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
89 bool load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug);
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
90 #endif
724675f7f7cb [project @ 2004-09-08 17:00:20 by jwe]
jwe
parents: 4967
diff changeset
91
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
92 void print (std::ostream& os, bool pr_as_read_syntax = false) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
93
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
94 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
95
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
96 private:
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
97
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
98 DECLARE_OCTAVE_ALLOCATOR
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
99
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
100 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
101
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
102 // The expression of an inline function.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
103 std::string iftext;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
104
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
105 // The args of an inline function.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
106 string_vector ifargs;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
107 };
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
108
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
109 #endif
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
110
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
111 /*
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
112 ;;; Local Variables: ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
113 ;;; mode: C++ ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
114 ;;; End: ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
115 */
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
116