comparison src/ov-builtin.h @ 3219:30770ba4457a

[project @ 1998-11-13 03:44:31 by jwe]
author jwe
date Fri, 13 Nov 1998 03:44:36 +0000
parents ebbc34ff7f66
children 2efa28a91e7a
comparison
equal deleted inserted replaced
3218:2c91af0db179 3219:30770ba4457a
48 const string& ds = string ()) 48 const string& ds = string ())
49 : octave_function (nm, ds), f (ff) { } 49 : octave_function (nm, ds), f (ff) { }
50 50
51 ~octave_builtin (void) { } 51 ~octave_builtin (void) { }
52 52
53 void *operator new (size_t size)
54 { return allocator.alloc (size); }
55
56 void operator delete (void *p, size_t size)
57 { allocator.free (p, size); }
58
59 octave_function *function_value (bool) { return this; } 53 octave_function *function_value (bool) { return this; }
60 54
61 octave_value_list do_index_op (int nargout, const octave_value_list& args); 55 octave_value_list do_index_op (int nargout, const octave_value_list& args);
62
63 int type_id (void) const { return t_id; }
64
65 string type_name (void) const { return t_name; }
66
67 static int static_type_id (void) { return t_id; }
68
69 static void register_type (void)
70 { t_id = octave_value_typeinfo::register_type (t_name); }
71 56
72 private: 57 private:
73 58
74 octave_builtin (void); 59 octave_builtin (void);
75 60
76 octave_builtin (const octave_builtin& m); 61 octave_builtin (const octave_builtin& m);
77 62
78 // A pointer to the actual function. 63 // A pointer to the actual function.
79 fcn f; 64 fcn f;
80 65
81 // For custom memory management. 66 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
82 static octave_allocator allocator;
83 67
84 // Type id of list objects, set by register_type(). 68 DECLARE_OCTAVE_ALLOCATOR
85 static int t_id;
86
87 // Type name of list objects, defined in ov-list.cc.
88 static const string t_name;
89 }; 69 };
90 70
91 #endif 71 #endif
92 72
93 /* 73 /*