Mercurial > hg > octave-nkf
annotate src/ov-fcn.h @ 7758:8e14a01ffe9f
input.cc (Fre_read_readline_init_file): new function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 05 May 2008 03:21:52 -0400 |
parents | 8e4592e49fa7 |
children | 5adeea5de26c |
rev | line source |
---|---|
2974 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, |
4 2006, 2007 John W. Eaton | |
2974 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2974 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2974 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_function_h) | |
25 #define octave_function_h 1 | |
26 | |
27 #include <string> | |
28 | |
3258 | 29 #include "oct-time.h" |
3325 | 30 #include "str-vec.h" |
3258 | 31 |
2974 | 32 #include "oct-alloc.h" |
4748 | 33 #include "oct-obj.h" |
2974 | 34 #include "ov-base.h" |
35 #include "ov-typeinfo.h" | |
7336 | 36 #include "symtab.h" |
2974 | 37 |
2976 | 38 class tree_walker; |
39 | |
2974 | 40 // Functions. |
41 | |
42 class | |
6109 | 43 OCTINTERP_API |
2974 | 44 octave_function : public octave_base_value |
45 { | |
46 public: | |
47 | |
4645 | 48 octave_function (void) { } |
2974 | 49 |
50 ~octave_function (void) { } | |
51 | |
5759 | 52 octave_base_value *clone (void) const; |
53 octave_base_value *empty_clone (void) const; | |
2974 | 54 |
55 bool is_defined (void) const { return true; } | |
56 | |
57 bool is_function (void) const { return true; } | |
58 | |
3544 | 59 virtual bool is_system_fcn_file (void) const { return false; } |
2974 | 60 |
3523 | 61 virtual std::string fcn_file_name (void) const { return std::string (); } |
2974 | 62 |
6323 | 63 virtual std::string parent_fcn_name (void) const { return std::string (); } |
64 | |
3255 | 65 virtual void mark_fcn_file_up_to_date (const octave_time&) { } |
3166 | 66 |
7336 | 67 virtual symbol_table::scope_id scope (void) { return -1; } |
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 |
4343 | 75 virtual bool is_nested_function (void) const { return false; } |
76 | |
7336 | 77 virtual bool is_class_constructor (void) const { return false; } |
5744 | 78 |
7336 | 79 virtual bool is_class_method (void) const { return false; } |
80 | |
81 virtual std::string dispatch_class (void) const { return std::string (); } | |
4748 | 82 |
83 virtual bool takes_varargs (void) const { return false; } | |
84 | |
85 virtual bool takes_var_return (void) const { return false; } | |
86 | |
7336 | 87 std::string dir_name (void) const { return my_dir_name; } |
88 | |
89 void stash_dir_name (const std::string& dir) { my_dir_name = dir; } | |
90 | |
91 void lock (void) { locked = true; } | |
92 | |
93 void unlock (void) { locked = false; } | |
94 | |
7489
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7438
diff
changeset
|
95 bool islocked (void) const { return locked; } |
7336 | 96 |
6323 | 97 void mark_relative (void) { relative = true; } |
98 | |
99 bool is_relative (void) const { return relative; } | |
100 | |
3523 | 101 std::string name (void) const { return my_name; } |
2974 | 102 |
5823 | 103 void document (const std::string& ds) { doc = ds; } |
104 | |
3523 | 105 std::string doc_string (void) const { return doc; } |
2974 | 106 |
3325 | 107 virtual void unload (void) { } |
108 | |
2976 | 109 virtual void accept (tree_walker&) { } |
110 | |
2974 | 111 protected: |
112 | |
5864 | 113 octave_function (const std::string& nm, |
114 const std::string& ds = std::string ()) | |
6323 | 115 : relative (false), my_name (nm), doc (ds) { } |
116 | |
117 // TRUE if this function was found from a relative path element. | |
118 bool relative; | |
2974 | 119 |
7336 | 120 // TRUE if this function is tagged so that it can't be cleared. |
121 bool locked; | |
122 | |
2974 | 123 // The name of this function. |
3523 | 124 std::string my_name; |
2974 | 125 |
7336 | 126 // The name of the directory in the path where we found this |
127 // function. May be relative. | |
128 std::string my_dir_name; | |
129 | |
2974 | 130 // The help text for this function. |
3523 | 131 std::string doc; |
2974 | 132 |
3325 | 133 private: |
134 | |
4645 | 135 // No copying! |
136 | |
137 octave_function (const octave_function& f); | |
138 | |
139 octave_function& operator = (const octave_function& f); | |
140 | |
3219 | 141 DECLARE_OCTAVE_ALLOCATOR |
2974 | 142 }; |
143 | |
144 #endif | |
145 | |
146 /* | |
6705 | 147 ;;; Local Variables: *** |
148 ;;; mode: C++ *** | |
149 ;;; End: *** | |
2974 | 150 */ |