GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-builtin.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-2024 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include "error.h"
31 #include "errwarn.h"
32 #include "interpreter-private.h"
33 #include "interpreter.h"
34 #include "ov-builtin.h"
35 #include "ov.h"
36 #include "ovl.h"
37 #include "profiler.h"
38 #include "unwind-prot.h"
39 
40 
42  "built-in function",
43  "built-in function");
44 
46 octave_builtin::execute (octave::tree_evaluator& tw, int nargout,
47  const octave_value_list& args)
48 {
49  return tw.execute_builtin_function (*this, nargout, args);
50 }
51 
54 {
55  return m_fcn;
56 }
57 
60 {
61  return m_meth;
62 }
63 
64 void
65 octave_builtin::push_dispatch_class (const std::string& dispatch_type)
66 {
67  m_dispatch_classes.insert (dispatch_type);
68 }
69 
70 bool
71 octave_builtin::handles_dispatch_class (const std::string& dispatch_type) const
72 {
73  return m_dispatch_classes.find (dispatch_type) != m_dispatch_classes.end ();
74 }
bool handles_dispatch_class(const std::string &dispatch_type) const
Definition: ov-builtin.cc:71
std::set< std::string > m_dispatch_classes
Definition: ov-builtin.h:117
octave_value_list execute(octave::tree_evaluator &tw, int nargout=0, const octave_value_list &args=octave_value_list())
Definition: ov-builtin.cc:46
meth method() const
Definition: ov-builtin.cc:59
octave_value_list(* fcn)(const octave_value_list &, int)
Definition: ov-builtin.h:63
octave_value_list(* meth)(octave::interpreter &, const octave_value_list &, int)
Definition: ov-builtin.h:60
fcn function() const
Definition: ov-builtin.cc:53
void push_dispatch_class(const std::string &dispatch_type)
Definition: ov-builtin.cc:65
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
Definition: ov-base.h:235