GNU Octave 7.1.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-2022 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#include "cdef-fwd.h"
35
36class octave_value;
37class Cell;
38
39namespace octave
40{
41 extern OCTINTERP_API std::string
42 get_base_name (const std::string& nm);
43
44 extern OCTINTERP_API void
45 make_function_of_class (const std::string& class_name,
46 const octave_value& fcn);
47
48 extern OCTINTERP_API void
49 make_function_of_class (const cdef_class& cls, const octave_value& fcn);
50
51 extern OCTINTERP_API cdef_class
52 lookup_class (const std::string& name, bool error_if_not_found = true,
53 bool load_if_not_found = true);
54
55 extern OCTINTERP_API cdef_class
56 lookup_class (const cdef_class& cls);
57
58 extern OCTINTERP_API cdef_class
59 lookup_class (const octave_value& ov);
60
61 extern OCTINTERP_API std::list<cdef_class>
62 lookup_classes (const Cell& cls_list);
63
64 extern OCTINTERP_API octave_value
65 to_ov (const cdef_object& obj);
66
67 extern OCTINTERP_API octave_value
68 to_ov (const octave_value& ov);
69
70 extern OCTINTERP_API cdef_object
71 to_cdef (const octave_value& val);
72
73 extern OCTINTERP_API cdef_object&
74 to_cdef_ref (const octave_value& val);
75
76 extern OCTINTERP_API cdef_object
77 to_cdef (const cdef_object& obj);
78
79 extern OCTINTERP_API octave_value
80 to_ov (const std::list<cdef_class>& class_list);
81
82 extern OCTINTERP_API bool
83 is_dummy_method (const octave_value& fcn);
84
85 extern OCTINTERP_API bool
86 is_superclass (const cdef_class& clsa, const cdef_class& clsb,
87 bool allow_equal = true, int max_depth = -1);
88 extern OCTINTERP_API bool
89 is_strict_superclass (const cdef_class& clsa, const cdef_class& clsb);
90
91 extern OCTINTERP_API bool
92 is_direct_superclass (const cdef_class& clsa, const cdef_class& clsb);
93
94 extern OCTINTERP_API cdef_package
95 lookup_package (const std::string& name, bool error_if_not_found = true,
96 bool load_if_not_found = true);
97
98 extern OCTINTERP_API cdef_class
99 get_class_context (std::string& name, bool& in_constructor);
100
101 extern OCTINTERP_API cdef_class
102 get_class_context (void);
103
104 extern OCTINTERP_API bool
105 check_access (const cdef_class& cls, const octave_value& acc,
106 const std::string& meth_name = "",
107 const std::string& prop_name = "",
108 bool is_prop_set = false);
109}
110
111#endif
Definition: Cell.h:43
QString name
octave_value to_ov(const cdef_object &obj)
Definition: cdef-utils.cc:128
bool is_dummy_method(const octave_value &fcn)
Definition: cdef-utils.cc:179
bool is_superclass(const cdef_class &clsa, const cdef_class &clsb, bool allow_equal, int max_depth)
Definition: cdef-utils.cc:200
cdef_class get_class_context(std::string &name, bool &in_constructor)
Definition: cdef-utils.cc:247
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
class OCTINTERP_API cdef_class
Definition: cdef-fwd.h:33
class OCTINTERP_API cdef_object
Definition: cdef-fwd.h:34
std::string get_base_name(const std::string &nm)
Definition: cdef-utils.cc:44
cdef_object & to_cdef_ref(const octave_value &val)
Definition: cdef-utils.cc:152
cdef_object to_cdef(const octave_value &val)
Definition: cdef-utils.cc:143
cdef_class lookup_class(const std::string &name, bool error_if_not_found, bool load_if_not_found)
Definition: cdef-utils.cc:80
bool is_direct_superclass(const cdef_class &clsa, const cdef_class &clsb)
Definition: cdef-utils.cc:232
class OCTINTERP_API cdef_package
Definition: cdef-fwd.h:35
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
bool is_strict_superclass(const cdef_class &clsa, const cdef_class &clsb)
Definition: cdef-utils.cc:226
cdef_package lookup_package(const std::string &name, bool error_if_not_found, bool load_if_not_found)
Definition: cdef-utils.cc:238