2974
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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 |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
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 |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_function_h) |
|
24 #define octave_function_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
2974
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <string> |
|
31 |
3258
|
32 #include "oct-time.h" |
3325
|
33 #include "str-vec.h" |
3258
|
34 |
2974
|
35 #include "oct-alloc.h" |
4748
|
36 #include "oct-obj.h" |
2974
|
37 #include "ov-base.h" |
|
38 #include "ov-typeinfo.h" |
|
39 |
2976
|
40 class tree_walker; |
|
41 |
2974
|
42 // Functions. |
|
43 |
|
44 class |
|
45 octave_function : public octave_base_value |
|
46 { |
|
47 public: |
|
48 |
4645
|
49 octave_function (void) { } |
2974
|
50 |
|
51 ~octave_function (void) { } |
|
52 |
4579
|
53 octave_value *clone (void) const; |
|
54 octave_value *empty_clone (void) const; |
2974
|
55 |
|
56 bool is_defined (void) const { return true; } |
|
57 |
|
58 bool is_function (void) const { return true; } |
|
59 |
3325
|
60 virtual bool is_dynamically_loaded_function (void) const { return false; } |
|
61 |
3544
|
62 virtual bool is_system_fcn_file (void) const { return false; } |
2974
|
63 |
3523
|
64 virtual std::string fcn_file_name (void) const { return std::string (); } |
2974
|
65 |
3255
|
66 virtual void mark_fcn_file_up_to_date (const octave_time&) { } |
3166
|
67 |
3255
|
68 virtual octave_time time_parsed (void) const |
|
69 { return octave_time (static_cast<time_t> (0)); } |
2974
|
70 |
3255
|
71 virtual octave_time time_checked (void) const |
|
72 { return octave_time (static_cast<time_t> (0)); } |
3166
|
73 |
4343
|
74 virtual bool is_nested_function (void) const { return false; } |
|
75 |
4748
|
76 virtual bool is_user_function (void) const { return false; } |
|
77 |
|
78 virtual bool takes_varargs (void) const { return false; } |
|
79 |
|
80 virtual void octave_va_start (void) { } |
|
81 |
|
82 virtual octave_value octave_va_arg (void) const { return octave_value (); } |
|
83 |
|
84 virtual octave_value_list octave_all_va_args (void) |
|
85 { return octave_value_list (); } |
|
86 |
|
87 virtual bool takes_var_return (void) const { return false; } |
|
88 |
|
89 virtual void octave_vr_val (const octave_value& val) { } |
|
90 |
|
91 virtual bool has_varargout (void) const { return false; } |
|
92 |
3523
|
93 std::string name (void) const { return my_name; } |
2974
|
94 |
3523
|
95 std::string doc_string (void) const { return doc; } |
2974
|
96 |
3325
|
97 virtual void unload (void) { } |
|
98 |
2976
|
99 virtual void accept (tree_walker&) { } |
|
100 |
2974
|
101 protected: |
|
102 |
3523
|
103 octave_function (const std::string& nm, const std::string& ds) |
2974
|
104 : my_name (nm), doc (ds) { } |
|
105 |
|
106 // The name of this function. |
3523
|
107 std::string my_name; |
2974
|
108 |
|
109 // The help text for this function. |
3523
|
110 std::string doc; |
2974
|
111 |
3325
|
112 private: |
|
113 |
4645
|
114 // No copying! |
|
115 |
|
116 octave_function (const octave_function& f); |
|
117 |
|
118 octave_function& operator = (const octave_function& f); |
|
119 |
3219
|
120 DECLARE_OCTAVE_ALLOCATOR |
2974
|
121 }; |
|
122 |
|
123 #endif |
|
124 |
|
125 /* |
|
126 ;; Local Variables: *** |
|
127 ;; mode: C++ *** |
|
128 ;; End: *** |
|
129 */ |