4933
|
1 /* |
|
2 |
|
3 Copyright (C) 2004 David Bateman |
|
4 |
|
5 This program is free software; you can redistribute it and/or modify it |
|
6 under the terms of the GNU General Public License as published by |
|
7 the Free Software Foundation; either version 2, or (at your option) |
|
8 any later version. |
|
9 |
|
10 This program is distributed in the hope that it will be useful, but |
|
11 WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU General Public License |
|
16 along with Octave; see the file COPYING. If not, write to the Free |
|
17 Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
18 02111-1307, USA. |
|
19 |
|
20 In addition to the terms of the GPL, you are permitted to link |
|
21 this program with any Open Source program, as defined by the |
|
22 Open Source Initiative (www.opensource.org) |
|
23 |
|
24 */ |
|
25 |
|
26 #if !defined (octave_fcn_inline_h) |
|
27 #define octave_fcn_inline_h 1 |
|
28 |
|
29 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
|
30 #pragma interface |
|
31 #endif |
|
32 |
|
33 #include <iostream> |
|
34 #include <string> |
|
35 |
|
36 #include "oct-alloc.h" |
|
37 |
|
38 #include "ov-base.h" |
|
39 #include "ov-base-mat.h" |
|
40 #include "ov-fcn.h" |
|
41 #include "ov-typeinfo.h" |
|
42 #include "symtab.h" |
|
43 #include "ov-fcn-handle.h" |
|
44 |
|
45 // Inline functions. |
|
46 |
|
47 class |
|
48 octave_fcn_inline : public octave_fcn_handle |
|
49 { |
|
50 public: |
|
51 |
|
52 octave_fcn_inline (void) |
|
53 : octave_fcn_handle(), iftext (), ifargs () { } |
|
54 |
|
55 octave_fcn_inline (const std::string& f, const string_vector& a, |
|
56 const std::string& n = std::string ()); |
|
57 |
|
58 ~octave_fcn_inline (void) { } |
|
59 |
|
60 octave_fcn_inline *fcn_inline_value (bool = false) { return this; } |
|
61 |
|
62 std::string fcn_text (void) const { return iftext; } |
|
63 |
|
64 string_vector fcn_arg_names (void) const { return ifargs; } |
|
65 |
|
66 octave_value convert_to_str_internal (bool, bool) const; |
|
67 |
|
68 void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
69 |
|
70 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
|
71 |
|
72 private: |
|
73 |
|
74 // No copying! |
|
75 |
|
76 octave_fcn_inline (const octave_fcn_inline& fh); |
|
77 |
|
78 octave_fcn_inline& operator = (const octave_fcn_inline& fh); |
|
79 |
|
80 DECLARE_OCTAVE_ALLOCATOR |
|
81 |
|
82 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
|
83 |
|
84 // The expression of an inline function. |
|
85 std::string iftext; |
|
86 |
|
87 // The args of an inline function. |
|
88 string_vector ifargs; |
|
89 }; |
|
90 |
|
91 #endif |
|
92 |
|
93 /* |
|
94 ;;; Local Variables: *** |
|
95 ;;; mode: C++ *** |
|
96 ;;; End: *** |
|
97 */ |
|
98 |