GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
cdef-utils.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2012-2021 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 (octave_cdef_utils_h)
27 #define octave_cdef_utils_h 1
28 
29 #include "octave-config.h"
30 
31 #include <list>
32 #include <string>
33 
34 class octave_value;
35 class Cell;
36 
37 namespace octave
38 {
39  class cdef_class;
40  class cdef_package;
41 
42  extern std::string
43  get_base_name (const std::string& nm);
44 
45  extern void
46  make_function_of_class (const std::string& class_name,
47  const octave_value& fcn);
48 
49  extern void
50  make_function_of_class (const cdef_class& cls, const octave_value& fcn);
51 
52  extern cdef_class
53  lookup_class (const std::string& name, bool error_if_not_found = true,
54  bool load_if_not_found = true);
55 
56  extern cdef_class
57  lookup_class (const cdef_class& cls);
58 
59  extern cdef_class
60  lookup_class (const octave_value& ov);
61 
62  extern std::list<cdef_class>
63  lookup_classes (const Cell& cls_list);
64 
65  extern octave_value
66  to_ov (const cdef_object& obj);
67 
68  extern octave_value
69  to_ov (const octave_value& ov);
70 
71  extern cdef_object
72  to_cdef (const octave_value& val);
73 
74  extern cdef_object&
75  to_cdef_ref (const octave_value& val);
76 
77  extern cdef_object
78  to_cdef (const cdef_object& obj);
79 
80  extern octave_value
81  to_ov (const std::list<cdef_class>& class_list);
82 
83  extern bool
84  is_dummy_method (const octave_value& fcn);
85 
86  extern bool
87  is_superclass (const cdef_class& clsa, const cdef_class& clsb,
88  bool allow_equal = true, int max_depth = -1);
89  extern bool
90  is_strict_superclass (const cdef_class& clsa, const cdef_class& clsb);
91 
92  extern bool
93  is_direct_superclass (const cdef_class& clsa, const cdef_class& clsb);
94 
95  extern cdef_package
96  lookup_package (const std::string& name, bool error_if_not_found = true,
97  bool load_if_not_found = true);
98 
99  extern cdef_class
100  get_class_context (std::string& name, bool& in_constructor);
101 
102  extern cdef_class
103  get_class_context (void);
104 
105  extern bool
106  check_access (const cdef_class& cls, const octave_value& acc,
107  const std::string& meth_name = "",
108  const std::string& prop_name = "",
109  bool is_prop_set = false);
110 }
111 
112 #endif
Definition: Cell.h:43
QString name
bool is_superclass(const cdef_class &clsa, const cdef_class &clsb, bool allow_equal, int max_depth)
Definition: cdef-utils.cc:200
std::list< cdef_class > lookup_classes(const Cell &cls_list)
Definition: cdef-utils.cc:113
void make_function_of_class(const std::string &class_name, const octave_value &fcn)
Definition: cdef-utils.cc:55
bool is_dummy_method(const octave_value &fcn)
Definition: cdef-utils.cc:179
octave_value to_ov(const cdef_object &obj)
Definition: cdef-utils.cc:128
bool is_direct_superclass(const cdef_class &clsa, const cdef_class &clsb)
Definition: cdef-utils.cc:232
cdef_object to_cdef(const octave_value &val)
Definition: cdef-utils.cc:143
bool check_access(const cdef_class &cls, const octave_value &acc, const std::string &meth_name, const std::string &prop_name, bool is_prop_set)
Definition: cdef-utils.cc:294
cdef_class get_class_context(std::string &name, bool &in_constructor)
Definition: cdef-utils.cc:247
cdef_package lookup_package(const std::string &name, bool error_if_not_found, bool load_if_not_found)
Definition: cdef-utils.cc:238
cdef_class lookup_class(const std::string &name, bool error_if_not_found, bool load_if_not_found)
Definition: cdef-utils.cc:80
cdef_object & to_cdef_ref(const octave_value &val)
Definition: cdef-utils.cc:152
bool is_strict_superclass(const cdef_class &clsa, const cdef_class &clsb)
Definition: cdef-utils.cc:226
std::string get_base_name(const std::string &nm)
Definition: cdef-utils.cc:44