Mercurial > jwe > octave
annotate libinterp/octave-value/ov-dld-fcn.h @ 30870:4026b5fbc67d
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 24 Mar 2022 12:11:10 -0400 |
parents | 83f9f8bda883 5fa3d8f0dcb3 |
children | c9788d7f6e65 |
rev | line source |
---|---|
27928
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
2 // |
30569
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30082
diff
changeset
|
3 // Copyright (C) 1996-2022 The Octave Project Developers |
27928
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27924
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
3329 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_ov_dld_fcn_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
27 #define octave_ov_dld_fcn_h 1 |
3329 | 28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
30 |
3329 | 31 #include <string> |
32 | |
33 #include "oct-shlib.h" | |
34 | |
35 #include "ov-fcn.h" | |
36 #include "ov-builtin.h" | |
37 #include "ov-typeinfo.h" | |
38 | |
39 class octave_value; | |
40 class octave_value_list; | |
41 | |
42 // Dynamically-linked functions. | |
43 | |
44 class | |
7349 | 45 OCTINTERP_API |
3329 | 46 octave_dld_function : public octave_builtin |
47 { | |
48 public: | |
49 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
50 octave_dld_function (void) |
30869
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30569
diff
changeset
|
51 : m_sh_lib (), m_time_checked (), m_system_fcn_file () |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
52 { } |
4641 | 53 |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
54 octave_dld_function (octave_builtin::fcn ff, |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
55 const octave::dynamic_library& shl, |
21017
93748bcaec17
maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
56 const std::string& nm = "", |
93748bcaec17
maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
57 const std::string& ds = ""); |
3329 | 58 |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
59 octave_dld_function (octave_builtin::meth mm, |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
60 const octave::dynamic_library& shl, |
23518 | 61 const std::string& nm = "", |
62 const std::string& ds = ""); | |
63 | |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
64 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
65 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
66 octave_dld_function (const octave_dld_function& fn) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
67 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
68 octave_dld_function& operator = (const octave_dld_function& fn) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
69 |
3329 | 70 ~octave_dld_function (void); |
71 | |
30351
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30082
diff
changeset
|
72 void mark_fcn_file_up_to_date (const octave::sys::time& t) |
30870 | 73 { m_time_checked = t; } |
3329 | 74 |
3523 | 75 std::string fcn_file_name (void) const; |
3329 | 76 |
21730
30c53770f47e
use namespace for system time classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
77 octave::sys::time time_parsed (void) const; |
3329 | 78 |
30869
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30569
diff
changeset
|
79 octave::sys::time time_checked (void) const { return m_time_checked; } |
3329 | 80 |
30082
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29363
diff
changeset
|
81 bool is_system_fcn_file (void) const { return m_system_fcn_file; } |
3329 | 82 |
83 bool is_builtin_function (void) const { return false; } | |
84 | |
85 bool is_dld_function (void) const { return true; } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
86 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
87 static octave_dld_function * create (octave_builtin::fcn ff, |
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
88 const octave::dynamic_library& shl, |
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
89 const std::string& nm = "", |
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
90 const std::string& ds = ""); |
3329 | 91 |
23518 | 92 static octave_dld_function * create (octave_builtin::meth mm, |
93 const octave::dynamic_library& shl, | |
94 const std::string& nm = "", | |
95 const std::string& ds = ""); | |
96 | |
21750
6720e5a220ba
use namespace for octave_shlib class
John W. Eaton <jwe@octave.org>
parents:
21730
diff
changeset
|
97 octave::dynamic_library get_shlib (void) const |
30082
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29363
diff
changeset
|
98 { return m_sh_lib; } |
9960
5f3c10ecb150
implement get_current_shlib and octave_auto_shlib
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
99 |
3329 | 100 private: |
101 | |
30082
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29363
diff
changeset
|
102 octave::dynamic_library m_sh_lib; |
3329 | 103 |
104 // The time the file was last checked to see if it needs to be | |
105 // parsed again. | |
30869
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30569
diff
changeset
|
106 octave::sys::time m_time_checked; |
3329 | 107 |
108 // True if this function came from a file that is considered to be a | |
109 // system function. This affects whether we check the time stamp | |
110 // on the file to see if it has changed. | |
30082
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29363
diff
changeset
|
111 bool m_system_fcn_file; |
3329 | 112 |
4612 | 113 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
3329 | 114 }; |
115 | |
116 #endif |