GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov-typeinfo.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2015 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 3 of the License, or (at your
10 option) any 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, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
26 
27 #include "Array.h"
28 #include "singleton-cleanup.h"
29 
30 #include "defun.h"
31 #include "error.h"
32 #include "ov-typeinfo.h"
33 
34 const int
36 
39 
40 bool
42 {
43  bool retval = true;
44 
45  if (! instance)
46  {
48 
49  if (instance)
51  }
52 
53  if (! instance)
54  {
55  ::error ("unable to create value type info object!");
56 
57  retval = false;
58  }
59 
60  return retval;
61 }
62 
63 int
64 octave_value_typeinfo::register_type (const std::string& t_name,
65  const std::string& c_name,
66  const octave_value& val)
67 {
68  return (instance_ok ())
69  ? instance->do_register_type (t_name, c_name, val) : -1;
70 }
71 
72 bool
75 {
76  return (instance_ok ())
77  ? instance->do_register_unary_class_op (op, f) : false;
78 }
79 
80 bool
82  int t,
84 {
85  return (instance_ok ())
86  ? instance->do_register_unary_op (op, t, f) : false;
87 }
88 
89 bool
91  int t,
93 {
94  return (instance_ok ())
95  ? instance->do_register_non_const_unary_op (op, t, f) : false;
96 }
97 
98 bool
101 {
102  return (instance_ok ())
103  ? instance->do_register_binary_class_op (op, f) : false;
104 }
105 
106 bool
108  int t1, int t2,
110 {
111  return (instance_ok ())
112  ? instance->do_register_binary_op (op, t1, t2, f) : false;
113 }
114 
115 bool
118 {
119  return (instance_ok ())
120  ? instance->do_register_binary_class_op (op, f) : false;
121 }
122 
123 bool
125  int t1, int t2,
127 {
128  return (instance_ok ())
129  ? instance->do_register_binary_op (op, t1, t2, f) : false;
130 }
131 
132 bool
135 {
136  return (instance_ok ())
137  ? instance->do_register_cat_op (t1, t2, f) : false;
138 }
139 
140 bool
142  int t_lhs, int t_rhs,
144 {
145  return (instance_ok ())
146  ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1;
147 }
148 
149 bool
152 {
153  return (instance_ok ())
154  ? instance->do_register_assignany_op (op, t_lhs, f) : -1;
155 }
156 
157 bool
159  int t_result)
160 {
161  return (instance_ok ())
162  ? instance->do_register_pref_assign_conv (t_lhs, t_rhs, t_result)
163  : false;
164 }
165 
166 bool
169 {
170  return (instance_ok ())
171  ? instance->do_register_type_conv_op (t, t_result, f) : false;
172 }
173 
174 bool
177 {
178  return (instance_ok ())
179  ? instance->do_register_widening_op (t, t_result, f) : false;
180 }
181 
182 // FIXME: we should also store all class names and provide a
183 // way to list them (calling class with nargin == 0?).
184 
185 int
186 octave_value_typeinfo::do_register_type (const std::string& t_name,
187  const std::string& /* c_name */,
188  const octave_value& val)
189 {
190  int i = 0;
191 
192  for (i = 0; i < num_types; i++)
193  if (t_name == types (i))
194  return i;
195 
196  int len = types.length ();
197 
198  if (i == len)
199  {
200  len *= 2;
201 
202  types.resize (dim_vector (len, 1), std::string ());
203 
204  vals.resize (dim_vector (len, 1), octave_value ());
205 
207 
210 
212  (dim_vector (octave_value::num_binary_ops, len, len), 0);
213 
216 
217  cat_ops.resize (dim_vector (len, len), 0);
218 
220  (dim_vector (octave_value::num_assign_ops, len, len), 0);
221 
224 
225  pref_assign_conv.resize (dim_vector (len, len), -1);
226 
227  type_conv_ops.resize (dim_vector (len, len), 0);
228 
229  widening_ops.resize (dim_vector (len, len), 0);
230  }
231 
232  types (i) = t_name;
233 
234  vals (i) = val;
235 
236  num_types++;
237 
238  return i;
239 }
240 
241 bool
244 {
245  if (lookup_unary_class_op (op))
246  {
247  std::string op_name = octave_value::unary_op_as_string (op);
248 
249  warning ("duplicate unary operator '%s' for class dispatch",
250  op_name.c_str ());
251  }
252 
253  unary_class_ops.checkelem (static_cast<int> (op))
254  = reinterpret_cast<void *> (f);
255 
256  return false;
257 }
258 
259 bool
261  int t,
263 {
264  if (lookup_unary_op (op, t))
265  {
266  std::string op_name = octave_value::unary_op_as_string (op);
267  std::string type_name = types(t);
268 
269  warning ("duplicate unary operator '%s' for type '%s'",
270  op_name.c_str (), type_name.c_str ());
271  }
272 
273  unary_ops.checkelem (static_cast<int> (op), t) = reinterpret_cast<void *> (f);
274 
275  return false;
276 }
277 
278 bool
282 {
283  if (lookup_non_const_unary_op (op, t))
284  {
285  std::string op_name = octave_value::unary_op_as_string (op);
286  std::string type_name = types(t);
287 
288  warning ("duplicate unary operator '%s' for type '%s'",
289  op_name.c_str (), type_name.c_str ());
290  }
291 
292  non_const_unary_ops.checkelem (static_cast<int> (op), t)
293  = reinterpret_cast<void *> (f);
294 
295  return false;
296 }
297 
298 bool
301 {
302  if (lookup_binary_class_op (op))
303  {
304  std::string op_name = octave_value::binary_op_as_string (op);
305 
306  warning ("duplicate binary operator '%s' for class dispatch",
307  op_name.c_str ());
308  }
309 
310  binary_class_ops.checkelem (static_cast<int> (op))
311  = reinterpret_cast<void *> (f);
312 
313  return false;
314 }
315 
316 bool
318  int t1, int t2,
320 {
321  if (lookup_binary_op (op, t1, t2))
322  {
323  std::string op_name = octave_value::binary_op_as_string (op);
324  std::string t1_name = types(t1);
325  std::string t2_name = types(t2);
326 
327  warning ("duplicate binary operator '%s' for types '%s' and '%s'",
328  op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
329  }
330 
331  binary_ops.checkelem (static_cast<int> (op), t1, t2)
332  = reinterpret_cast<void *> (f);
333 
334  return false;
335 }
336 
337 bool
340 {
341  if (lookup_binary_class_op (op))
342  {
343  std::string op_name = octave_value::binary_op_fcn_name (op);
344 
345  warning ("duplicate compound binary operator '%s' for class dispatch",
346  op_name.c_str ());
347  }
348 
349  compound_binary_class_ops.checkelem (static_cast<int> (op))
350  = reinterpret_cast<void *> (f);
351 
352  return false;
353 }
354 
355 bool
357  int t1, int t2,
359 {
360  if (lookup_binary_op (op, t1, t2))
361  {
362  std::string op_name = octave_value::binary_op_fcn_name (op);
363  std::string t1_name = types(t1);
364  std::string t2_name = types(t2);
365 
366  warning ("duplicate compound binary operator '%s' for types '%s' and '%s'",
367  op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
368  }
369 
370  compound_binary_ops.checkelem (static_cast<int> (op), t1, t2)
371  = reinterpret_cast<void *> (f);
372 
373  return false;
374 }
375 
376 bool
379 {
380  if (lookup_cat_op (t1, t2))
381  {
382  std::string t1_name = types(t1);
383  std::string t2_name = types(t2);
384 
385  warning ("duplicate concatenation operator for types '%s' and '%s'",
386  t1_name.c_str (), t1_name.c_str ());
387  }
388 
389  cat_ops.checkelem (t1, t2) = reinterpret_cast<void *> (f);
390 
391  return false;
392 }
393 
394 bool
396  int t_lhs, int t_rhs,
398 {
399  if (lookup_assign_op (op, t_lhs, t_rhs))
400  {
401  std::string op_name = octave_value::assign_op_as_string (op);
402  std::string t_lhs_name = types(t_lhs);
403  std::string t_rhs_name = types(t_rhs);
404 
405  warning ("duplicate assignment operator '%s' for types '%s' and '%s'",
406  op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ());
407  }
408 
409  assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs)
410  = reinterpret_cast<void *> (f);
411 
412  return false;
413 }
414 
415 bool
418 {
419  if (lookup_assignany_op (op, t_lhs))
420  {
421  std::string op_name = octave_value::assign_op_as_string (op);
422  std::string t_lhs_name = types(t_lhs);
423 
424  warning ("duplicate assignment operator '%s' for types '%s'",
425  op_name.c_str (), t_lhs_name.c_str ());
426  }
427 
428  assignany_ops.checkelem (static_cast<int> (op), t_lhs)
429  = reinterpret_cast<void *> (f);
430 
431  return false;
432 }
433 
434 bool
436  int t_result)
437 {
438  if (lookup_pref_assign_conv (t_lhs, t_rhs) >= 0)
439  {
440  std::string t_lhs_name = types(t_lhs);
441  std::string t_rhs_name = types(t_rhs);
442 
443  warning ("overriding assignment conversion for types '%s' and '%s'",
444  t_lhs_name.c_str (), t_rhs_name.c_str ());
445  }
446 
447  pref_assign_conv.checkelem (t_lhs, t_rhs) = t_result;
448 
449  return false;
450 }
451 
452 bool
454  (int t, int t_result, octave_base_value::type_conv_fcn f)
455 {
456  if (lookup_type_conv_op (t, t_result))
457  {
458  std::string t_name = types(t);
459  std::string t_result_name = types(t_result);
460 
461  warning ("overriding type conversion op for '%s' to '%s'",
462  t_name.c_str (), t_result_name.c_str ());
463  }
464 
465  type_conv_ops.checkelem (t, t_result) = reinterpret_cast<void *> (f);
466 
467  return false;
468 }
469 
470 bool
472  (int t, int t_result, octave_base_value::type_conv_fcn f)
473 {
474  if (lookup_widening_op (t, t_result))
475  {
476  std::string t_name = types(t);
477  std::string t_result_name = types(t_result);
478 
479  warning ("overriding widening op for '%s' to '%s'",
480  t_name.c_str (), t_result_name.c_str ());
481  }
482 
483  widening_ops.checkelem (t, t_result) = reinterpret_cast<void *> (f);
484 
485  return false;
486 }
487 
490 {
491  octave_value retval;
492 
493  for (int i = 0; i < num_types; i++)
494  {
495  if (nm == types(i))
496  {
497  retval = vals(i);
498  retval.make_unique ();
499  break;
500  }
501  }
502 
503  return retval;
504 }
505 
508 {
509  void *f = unary_class_ops.checkelem (static_cast<int> (op));
510  return reinterpret_cast<octave_value_typeinfo::unary_class_op_fcn> (f);
511 }
512 
515 {
516  void *f = unary_ops.checkelem (static_cast<int> (op), t);
517  return reinterpret_cast<octave_value_typeinfo::unary_op_fcn> (f);
518 }
519 
523 {
524  void *f = non_const_unary_ops.checkelem (static_cast<int> (op), t);
525  return reinterpret_cast<octave_value_typeinfo::non_const_unary_op_fcn> (f);
526 }
527 
530 {
531  void *f = binary_class_ops.checkelem (static_cast<int> (op));
532  return reinterpret_cast<octave_value_typeinfo::binary_class_op_fcn> (f);
533 }
534 
537  int t1, int t2)
538 {
539  void *f = binary_ops.checkelem (static_cast<int> (op), t1, t2);
540  return reinterpret_cast<octave_value_typeinfo::binary_op_fcn> (f);
541 }
542 
545 {
546  void *f = compound_binary_class_ops.checkelem (static_cast<int> (op));
547  return reinterpret_cast<octave_value_typeinfo::binary_class_op_fcn> (f);
548 }
549 
552  int t1, int t2)
553 {
554  void *f = compound_binary_ops.checkelem (static_cast<int> (op), t1, t2);
555  return reinterpret_cast<octave_value_typeinfo::binary_op_fcn> (f);
556 }
557 
560 {
561  void *f = cat_ops.checkelem (t1, t2);
562  return reinterpret_cast<octave_value_typeinfo::cat_op_fcn> (f);
563 }
564 
567  int t_lhs, int t_rhs)
568 {
569  void *f = assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs);
570  return reinterpret_cast<octave_value_typeinfo::assign_op_fcn> (f);
571 }
572 
575  int t_lhs)
576 {
577  void *f = assignany_ops.checkelem (static_cast<int> (op), t_lhs);
578  return reinterpret_cast<octave_value_typeinfo::assignany_op_fcn> (f);
579 }
580 
581 int
583 {
584  return pref_assign_conv.checkelem (t_lhs, t_rhs);
585 }
586 
589 {
590  void *f = type_conv_ops.checkelem (t, t_result);
591  return reinterpret_cast<octave_base_value::type_conv_fcn> (f);
592 }
593 
596 {
597  void *f = widening_ops.checkelem (t, t_result);
598  return reinterpret_cast<octave_base_value::type_conv_fcn> (f);
599 }
600 
603 {
604  string_vector retval (num_types);
605 
606  for (int i = 0; i < num_types; i++)
607  retval(i) = types(i);
608 
609  return retval;
610 }
611 
612 DEFUN (typeinfo, args, ,
613  "-*- texinfo -*-\n\
614 @deftypefn {Built-in Function} {} typeinfo ()\n\
615 @deftypefnx {Built-in Function} {} typeinfo (@var{expr})\n\
616 \n\
617 Return the type of the expression @var{expr}, as a string.\n\
618 \n\
619 If @var{expr} is omitted, return a cell array of strings containing all the\n\
620 currently installed data types.\n\
621 @seealso{class, isa}\n\
622 @end deftypefn")
623 {
624  octave_value retval;
625 
626  int nargin = args.length ();
627 
628  if (nargin == 0)
630  else if (nargin == 1)
631  retval = args(0).type_name ();
632  else
633  print_usage ();
634 
635  return retval;
636 }
637 
638 /*
639 %!assert (iscellstr (typeinfo ()))
640 
641 %!assert (typeinfo ({"cell"}), "cell")
642 
643 %!assert (typeinfo (1), "scalar")
644 %!assert (typeinfo (double (1)), "scalar")
645 %!assert (typeinfo (i), "complex scalar")
646 
647 %!assert (typeinfo ([1, 2]), "matrix")
648 %!assert (typeinfo (double ([1, 2])), "matrix")
649 %!assert (typeinfo (diag ([1, 2])), "diagonal matrix")
650 %!assert (typeinfo ([i, 2]), "complex matrix")
651 %!assert (typeinfo (diag ([i, 2])), "complex diagonal matrix")
652 
653 %!assert (typeinfo (1:2), "range")
654 
655 %!assert (typeinfo (false), "bool")
656 %!assert (typeinfo ([true, false]), "bool matrix")
657 
658 %!assert (typeinfo ("string"), "string")
659 %!assert (typeinfo ('string'), "sq_string")
660 
661 %!assert (typeinfo (int8 (1)), "int8 scalar")
662 %!assert (typeinfo (int16 (1)), "int16 scalar")
663 %!assert (typeinfo (int32 (1)), "int32 scalar")
664 %!assert (typeinfo (int64 (1)), "int64 scalar")
665 %!assert (typeinfo (uint8 (1)), "uint8 scalar")
666 %!assert (typeinfo (uint16 (1)), "uint16 scalar")
667 %!assert (typeinfo (uint32 (1)), "uint32 scalar")
668 %!assert (typeinfo (uint64 (1)), "uint64 scalar")
669 
670 %!assert (typeinfo (int8 ([1,2])), "int8 matrix")
671 %!assert (typeinfo (int16 ([1,2])), "int16 matrix")
672 %!assert (typeinfo (int32 ([1,2])), "int32 matrix")
673 %!assert (typeinfo (int64 ([1,2])), "int64 matrix")
674 %!assert (typeinfo (uint8 ([1,2])), "uint8 matrix")
675 %!assert (typeinfo (uint16 ([1,2])), "uint16 matrix")
676 %!assert (typeinfo (uint32 ([1,2])), "uint32 matrix")
677 %!assert (typeinfo (uint64 ([1,2])), "uint64 matrix")
678 
679 %!assert (typeinfo (sparse ([true, false])), "sparse bool matrix")
680 %!assert (typeinfo (logical (sparse (i * eye (10)))), "sparse bool matrix")
681 %!assert (typeinfo (sparse ([1,2])), "sparse matrix")
682 %!assert (typeinfo (sparse (eye (10))), "sparse matrix")
683 %!assert (typeinfo (sparse ([i,2])), "sparse complex matrix")
684 %!assert (typeinfo (sparse (i * eye (10))), "sparse complex matrix")
685 
686 %!test
687 %! s(2).a = 1;
688 %! assert (typeinfo (s), "struct");
689 
690 %!test
691 %! s.a = 1;
692 %! assert (typeinfo (s), "scalar struct");
693 
694 ## FIXME: This doesn't work as a test for comma-separated list
695 %!#test
696 %! clist = {1, 2, 3};
697 %! assert (typeinfo (clist{:}), "cs-list");
698 
699 %!assert (typeinfo (@sin), "function handle")
700 %!assert (typeinfo (@(x) x), "function handle")
701 
702 %!assert (typeinfo (inline ("x^2")), "inline function")
703 
704 %!assert (typeinfo (single (1)), "float scalar")
705 %!assert (typeinfo (single (i)), "float complex scalar")
706 %!assert (typeinfo (single ([1, 2])), "float matrix")
707 
708 %!assert (typeinfo (single (diag ([1, 2]))), "float diagonal matrix")
709 %!assert (typeinfo (diag (single ([1, 2]))), "float diagonal matrix")
710 %!assert (typeinfo (single (diag ([i, 2]))), "float complex diagonal matrix")
711 %!assert (typeinfo (diag (single ([i, 2]))), "float complex diagonal matrix")
712 
713 %!assert (typeinfo (eye(3)(:,[1 3 2])), "permutation matrix")
714 %!test
715 %! [l, u, p] = lu (rand (3));
716 %! assert (typeinfo (p), "permutation matrix");
717 
718 %!assert (typeinfo ([]), "null_matrix")
719 %!assert (typeinfo (""), "null_string")
720 %!assert (typeinfo (''), "null_sq_string")
721 
722 %!test
723 %! cvar = onCleanup (@() "");
724 %! assert (typeinfo (cvar), "onCleanup");
725 
726 %!testif HAVE_JAVA
727 %! x = javaObject ("java.lang.StringBuffer");
728 %! assert (typeinfo (x), "octave_java");
729 
730 ## Test input validation
731 %!error typeinfo ("foo", 1)
732 */
static bool register_pref_assign_conv(int, int, int)
Definition: ov-typeinfo.cc:158
static bool register_assign_op(octave_value::assign_op, int, int, assign_op_fcn)
Definition: ov-typeinfo.cc:141
static const int init_tab_sz
Definition: ov-typeinfo.h:215
Array< void * > binary_ops
Definition: ov-typeinfo.h:235
void(* non_const_unary_op_fcn)(octave_base_value &)
Definition: ov-typeinfo.h:44
bool do_register_non_const_unary_op(octave_value::unary_op, int, non_const_unary_op_fcn)
Definition: ov-typeinfo.cc:280
Definition: Cell.h:35
bool do_register_type_conv_op(int, int, octave_base_value::type_conv_fcn)
Definition: ov-typeinfo.cc:454
assign_op
Definition: ov.h:131
octave_value(* binary_op_fcn)(const octave_base_value &, const octave_base_value &)
Definition: ov-typeinfo.h:50
OCTINTERP_API void print_usage(void)
Definition: defun.cc:51
static std::string binary_op_as_string(binary_op)
Definition: ov.cc:190
static void cleanup_instance(void)
Definition: ov-typeinfo.h:219
static string_vector installed_type_names(void)
Definition: ov-typeinfo.h:187
cat_op_fcn do_lookup_cat_op(int, int)
Definition: ov-typeinfo.cc:559
Array< int > pref_assign_conv
Definition: ov-typeinfo.h:247
Array< octave_value > vals
Definition: ov-typeinfo.h:225
binary_op
Definition: ov.h:87
Array< void * > binary_class_ops
Definition: ov-typeinfo.h:233
unary_op_fcn do_lookup_unary_op(octave_value::unary_op, int)
Definition: ov-typeinfo.cc:514
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:44
void error(const char *fmt,...)
Definition: error.cc:476
unary_class_op_fcn do_lookup_unary_class_op(octave_value::unary_op)
Definition: ov-typeinfo.cc:507
static bool register_type_conv_op(int, int, octave_base_value::type_conv_fcn)
Definition: ov-typeinfo.cc:167
static bool register_unary_class_op(octave_value::unary_op, unary_class_op_fcn)
Definition: ov-typeinfo.cc:73
void make_unique(void)
Definition: ov.h:326
octave_value(* binary_class_op_fcn)(const octave_value &, const octave_value &)
Definition: ov-typeinfo.h:47
static std::string assign_op_as_string(assign_op)
Definition: ov.cc:428
static binary_op_fcn lookup_binary_op(octave_value::binary_op op, int t1, int t2)
Definition: ov-typeinfo.h:134
static int lookup_pref_assign_conv(int t_lhs, int t_rhs)
Definition: ov-typeinfo.h:170
octave_base_value::type_conv_fcn do_lookup_widening_op(int, int)
Definition: ov-typeinfo.cc:595
bool do_register_binary_op(octave_value::binary_op, int, int, binary_op_fcn)
Definition: ov-typeinfo.cc:317
bool do_register_unary_op(octave_value::unary_op, int, unary_op_fcn)
Definition: ov-typeinfo.cc:260
static octave_value_typeinfo * instance
Definition: ov-typeinfo.h:217
assignany_op_fcn do_lookup_assignany_op(octave_value::assign_op, int)
Definition: ov-typeinfo.cc:574
static unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op op)
Definition: ov-typeinfo.h:110
binary_class_op_fcn do_lookup_binary_class_op(octave_value::binary_op)
Definition: ov-typeinfo.cc:529
octave_value(* cat_op_fcn)(octave_base_value &, const octave_base_value &, const Array< octave_idx_type > &ra_idx)
Definition: ov-typeinfo.h:53
non_const_unary_op_fcn do_lookup_non_const_unary_op(octave_value::unary_op, int)
Definition: ov-typeinfo.cc:522
F77_RET_T const double const double * f
octave_value(* unary_op_fcn)(const octave_base_value &)
Definition: ov-typeinfo.h:42
string_vector do_installed_type_names(void)
Definition: ov-typeinfo.cc:602
static assignany_op_fcn lookup_assignany_op(octave_value::assign_op op, int t_lhs)
Definition: ov-typeinfo.h:164
static void add(fptr f)
int do_lookup_pref_assign_conv(int, int)
Definition: ov-typeinfo.cc:582
Array< void * > non_const_unary_ops
Definition: ov-typeinfo.h:231
static std::string binary_op_fcn_name(binary_op)
Definition: ov.cc:288
assign_op_fcn do_lookup_assign_op(octave_value::assign_op, int, int)
Definition: ov-typeinfo.cc:566
Array< void * > assignany_ops
Definition: ov-typeinfo.h:245
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1033
Array< void * > unary_class_ops
Definition: ov-typeinfo.h:227
static bool register_non_const_unary_op(octave_value::unary_op, int, non_const_unary_op_fcn)
Definition: ov-typeinfo.cc:90
bool do_register_assignany_op(octave_value::assign_op, int, assignany_op_fcn)
Definition: ov-typeinfo.cc:416
static bool register_binary_op(octave_value::binary_op, int, int, binary_op_fcn)
Definition: ov-typeinfo.cc:107
octave_idx_type length(void) const
Definition: ov.cc:1525
static binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op op)
Definition: ov-typeinfo.h:128
bool do_register_assign_op(octave_value::assign_op, int, int, assign_op_fcn)
Definition: ov-typeinfo.cc:395
Array< void * > cat_ops
Definition: ov-typeinfo.h:241
bool do_register_unary_class_op(octave_value::unary_op, unary_class_op_fcn)
Definition: ov-typeinfo.cc:242
bool do_register_pref_assign_conv(int, int, int)
Definition: ov-typeinfo.cc:435
Array< void * > type_conv_ops
Definition: ov-typeinfo.h:249
void warning(const char *fmt,...)
Definition: error.cc:681
octave_value(* assignany_op_fcn)(octave_base_value &, const octave_value_list &, const octave_value &)
Definition: ov-typeinfo.h:60
bool do_register_widening_op(int, int, octave_base_value::type_conv_fcn)
Definition: ov-typeinfo.cc:472
std::string type_name(void) const
Definition: ov.h:1047
octave_idx_type length(void) const
Number of elements in the array.
Definition: Array.h:267
octave_value(* assign_op_fcn)(octave_base_value &, const octave_value_list &, const octave_base_value &)
Definition: ov-typeinfo.h:57
static bool register_widening_op(int, int, octave_base_value::type_conv_fcn)
Definition: ov-typeinfo.cc:175
bool do_register_binary_class_op(octave_value::binary_op, binary_class_op_fcn)
Definition: ov-typeinfo.cc:299
static cat_op_fcn lookup_cat_op(int t1, int t2)
Definition: ov-typeinfo.h:152
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
Definition: ov-base.h:185
static bool register_cat_op(int, int, cat_op_fcn)
Definition: ov-typeinfo.cc:133
T & checkelem(octave_idx_type n)
Definition: Array.cc:189
Array< void * > unary_ops
Definition: ov-typeinfo.h:229
static int register_type(const std::string &, const std::string &, const octave_value &)
Definition: ov-typeinfo.cc:64
Array< void * > assign_ops
Definition: ov-typeinfo.h:243
octave_value(* unary_class_op_fcn)(const octave_value &)
Definition: ov-typeinfo.h:40
compound_binary_op
Definition: ov.h:114
int do_register_type(const std::string &, const std::string &, const octave_value &)
Definition: ov-typeinfo.cc:186
Array< void * > widening_ops
Definition: ov-typeinfo.h:251
octave_base_value::type_conv_fcn do_lookup_type_conv_op(int, int)
Definition: ov-typeinfo.cc:588
octave_value do_lookup_type(const std::string &nm)
Definition: ov-typeinfo.cc:489
static assign_op_fcn lookup_assign_op(octave_value::assign_op op, int t_lhs, int t_rhs)
Definition: ov-typeinfo.h:158
static std::string unary_op_as_string(unary_op)
Definition: ov.cc:114
static bool instance_ok(void)
Definition: ov-typeinfo.cc:41
Array< void * > compound_binary_ops
Definition: ov-typeinfo.h:239
unary_op
Definition: ov.h:74
static bool register_binary_class_op(octave_value::binary_op, binary_class_op_fcn)
Definition: ov-typeinfo.cc:99
binary_op_fcn do_lookup_binary_op(octave_value::binary_op, int, int)
Definition: ov-typeinfo.cc:536
Array< std::string > types
Definition: ov-typeinfo.h:223
bool do_register_cat_op(int, int, cat_op_fcn)
Definition: ov-typeinfo.cc:377
static bool register_unary_op(octave_value::unary_op, int, unary_op_fcn)
Definition: ov-typeinfo.cc:81
static unary_op_fcn lookup_unary_op(octave_value::unary_op op, int t)
Definition: ov-typeinfo.h:116
static bool register_assignany_op(octave_value::assign_op, int, assignany_op_fcn)
Definition: ov-typeinfo.cc:150
Array< void * > compound_binary_class_ops
Definition: ov-typeinfo.h:237