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_builtin_h) |
|
24 #define octave_builtin_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <string> |
|
31 |
|
32 #include "ov-fcn.h" |
|
33 #include "ov-typeinfo.h" |
|
34 |
|
35 class octave_value; |
|
36 class octave_value_list; |
|
37 |
|
38 // Builtin functions. |
|
39 |
|
40 class |
|
41 octave_builtin : public octave_function |
|
42 { |
|
43 public: |
|
44 |
|
45 typedef octave_value_list (*fcn) (const octave_value_list&, int); |
|
46 |
|
47 octave_builtin (fcn ff, const string& nm = string (), |
|
48 const string& ds = string ()) |
|
49 : octave_function (nm, ds), f (ff) { } |
|
50 |
|
51 ~octave_builtin (void) { } |
|
52 |
|
53 octave_function *function_value (bool) { return this; } |
|
54 |
|
55 octave_value_list do_index_op (int nargout, const octave_value_list& args); |
|
56 |
|
57 private: |
|
58 |
|
59 octave_builtin (void); |
|
60 |
|
61 octave_builtin (const octave_builtin& m); |
|
62 |
|
63 // A pointer to the actual function. |
|
64 fcn f; |
|
65 |
3219
|
66 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2974
|
67 |
3219
|
68 DECLARE_OCTAVE_ALLOCATOR |
2974
|
69 }; |
|
70 |
|
71 #endif |
|
72 |
|
73 /* |
|
74 ;;; Local Variables: *** |
|
75 ;;; mode: C++ *** |
|
76 ;;; End: *** |
|
77 */ |