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 |
4066
|
26 #if defined (__GNUG__) && ! defined (NO_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" |
|
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 |
3933
|
53 octave_function *clone (void) const; |
|
54 octave_function *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 |
3523
|
74 std::string name (void) const { return my_name; } |
2974
|
75 |
3523
|
76 std::string doc_string (void) const { return doc; } |
2974
|
77 |
3325
|
78 virtual void unload (void) { } |
|
79 |
2976
|
80 virtual void accept (tree_walker&) { } |
|
81 |
2974
|
82 protected: |
|
83 |
3523
|
84 octave_function (const std::string& nm, const std::string& ds) |
2974
|
85 : my_name (nm), doc (ds) { } |
|
86 |
|
87 // The name of this function. |
3523
|
88 std::string my_name; |
2974
|
89 |
|
90 // The help text for this function. |
3523
|
91 std::string doc; |
2974
|
92 |
3325
|
93 private: |
|
94 |
|
95 octave_function (void); |
|
96 |
3219
|
97 DECLARE_OCTAVE_ALLOCATOR |
2974
|
98 }; |
|
99 |
|
100 #endif |
|
101 |
|
102 /* |
|
103 ;; Local Variables: *** |
|
104 ;; mode: C++ *** |
|
105 ;; End: *** |
|
106 */ |