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