42 DEFUN (__dispatch__, args, nargout,
43 "Undocumented internal function")
47 int nargin = args.
length ();
51 if (nargin > 0 && nargin < 4)
55 f = args(0).string_value ();
59 error (
"__dispatch__: first argument must be a function name");
70 error (
"__dispatch__: second argument must be a function name");
81 error (
"__dispatch__: third argument must be a type name");
93 size_t len = dm.size ();
95 Cell type_field (len, 1);
96 Cell name_field (len, 1);
98 symbol_table::fcn_info::dispatch_map_type::const_iterator p
101 for (
size_t i = 0; i < len; i++)
103 type_field(i) = p->first;
104 name_field(i) = p->second;
111 m.
assign (
"type", type_field);
112 m.
assign (
"name", name_field);
119 else if (nargin == 2)
static void clear_dispatch(const std::string &name, const std::string &type)
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
F77_RET_T const double const double * f
std::string string_value(bool force=false) const
static void add_dispatch(const std::string &name, const std::string &type, const std::string &fname)
static fcn_info::dispatch_map_type get_dispatch(const std::string &name)
octave_idx_type length(void) const
std::map< std::string, std::string > dispatch_map_type
void assign(const std::string &k, const octave_value &val)
static void print_dispatch(std::ostream &os, const std::string &name)