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 |
4643
|
30 #include <cstdlib> |
|
31 |
2974
|
32 #include <string> |
|
33 |
3258
|
34 #include "oct-time.h" |
3325
|
35 #include "str-vec.h" |
3258
|
36 |
2974
|
37 #include "oct-alloc.h" |
|
38 #include "ov-base.h" |
|
39 #include "ov-typeinfo.h" |
|
40 |
2976
|
41 class tree_walker; |
|
42 |
2974
|
43 // Functions. |
|
44 |
|
45 class |
|
46 octave_function : public octave_base_value |
|
47 { |
|
48 public: |
|
49 |
4643
|
50 octave_function (void) { abort (); } |
|
51 |
2974
|
52 octave_function (const octave_function& f) |
|
53 : octave_base_value (), my_name (f.my_name), doc (f.doc) { } |
|
54 |
|
55 ~octave_function (void) { } |
|
56 |
4579
|
57 octave_value *clone (void) const; |
|
58 octave_value *empty_clone (void) const; |
2974
|
59 |
|
60 bool is_defined (void) const { return true; } |
|
61 |
|
62 bool is_function (void) const { return true; } |
|
63 |
3325
|
64 virtual bool is_dynamically_loaded_function (void) const { return false; } |
|
65 |
3544
|
66 virtual bool is_system_fcn_file (void) const { return false; } |
2974
|
67 |
3523
|
68 virtual std::string fcn_file_name (void) const { return std::string (); } |
2974
|
69 |
3255
|
70 virtual void mark_fcn_file_up_to_date (const octave_time&) { } |
3166
|
71 |
3255
|
72 virtual octave_time time_parsed (void) const |
|
73 { return octave_time (static_cast<time_t> (0)); } |
2974
|
74 |
3255
|
75 virtual octave_time time_checked (void) const |
|
76 { return octave_time (static_cast<time_t> (0)); } |
3166
|
77 |
4343
|
78 virtual bool is_nested_function (void) const { return false; } |
|
79 |
3523
|
80 std::string name (void) const { return my_name; } |
2974
|
81 |
3523
|
82 std::string doc_string (void) const { return doc; } |
2974
|
83 |
3325
|
84 virtual void unload (void) { } |
|
85 |
2976
|
86 virtual void accept (tree_walker&) { } |
|
87 |
2974
|
88 protected: |
|
89 |
3523
|
90 octave_function (const std::string& nm, const std::string& ds) |
2974
|
91 : my_name (nm), doc (ds) { } |
|
92 |
|
93 // The name of this function. |
3523
|
94 std::string my_name; |
2974
|
95 |
|
96 // The help text for this function. |
3523
|
97 std::string doc; |
2974
|
98 |
3325
|
99 private: |
|
100 |
3219
|
101 DECLARE_OCTAVE_ALLOCATOR |
2974
|
102 }; |
|
103 |
|
104 #endif |
|
105 |
|
106 /* |
|
107 ;; Local Variables: *** |
|
108 ;; mode: C++ *** |
|
109 ;; End: *** |
|
110 */ |