annotate src/ov-fcn-inline.h @ 4933:cd58733c326b

[project @ 2004-08-05 16:08:28 by jwe]
author jwe
date Thu, 05 Aug 2004 16:08:28 +0000
parents
children ed0f3cb6d3d4
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)
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
53 : octave_fcn_handle(), iftext (), ifargs () { }
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
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
58 ~octave_fcn_inline (void) { }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
59
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
60 octave_fcn_inline *fcn_inline_value (bool = false) { return this; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
61
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
62 std::string fcn_text (void) const { return iftext; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
63
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
64 string_vector fcn_arg_names (void) const { return ifargs; }
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
65
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
66 octave_value convert_to_str_internal (bool, bool) const;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
67
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
68 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
69
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
70 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
71
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
72 private:
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 // No copying!
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
75
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
76 octave_fcn_inline (const octave_fcn_inline& fh);
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
77
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
78 octave_fcn_inline& operator = (const octave_fcn_inline& fh);
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
79
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
80 DECLARE_OCTAVE_ALLOCATOR
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
81
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
82 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
83
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
84 // The expression of an inline function.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
85 std::string iftext;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
86
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
87 // The args of an inline function.
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
88 string_vector ifargs;
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
89 };
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
90
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
91 #endif
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
92
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 ;;; Local Variables: ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
95 ;;; mode: C++ ***
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents:
diff changeset
96 ;;; End: ***
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