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