Mercurial > octave
annotate libinterp/octave-value/ov-dld-fcn.h @ 30864:5fa3d8f0dcb3 stable
don't use mutable keyword for dld_function and mex_function data members
* ov-dld-fcn.h (octave_dld_function::m_time_checked):
Rename from m_t_checked. Change all uses. Don't declare as mutable.
* ov-mex-fcn.h (octave_mex_function::m_time_checked):
Don't declare as mutable.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 24 Mar 2022 12:09:12 -0400 |
parents | 796f54d4ddbf |
children | 4026b5fbc67d |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30077
diff
changeset
|
3 // Copyright (C) 1996-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
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:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
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:
27919
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:
27919
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:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
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:
27919
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:
27919
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:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
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:
27919
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:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
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) |
30864
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30564
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 | |
30864
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
72 void mark_fcn_file_up_to_date (const octave::sys::time& t) { m_time_checked = t; } |
3329 | 73 |
3523 | 74 std::string fcn_file_name (void) const; |
3329 | 75 |
21730
30c53770f47e
use namespace for system time classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
76 octave::sys::time time_parsed (void) const; |
3329 | 77 |
30864
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
78 octave::sys::time time_checked (void) const { return m_time_checked; } |
3329 | 79 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
80 bool is_system_fcn_file (void) const { return m_system_fcn_file; } |
3329 | 81 |
82 bool is_builtin_function (void) const { return false; } | |
83 | |
84 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
|
85 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
86 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
|
87 const octave::dynamic_library& shl, |
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
88 const std::string& nm = "", |
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
89 const std::string& ds = ""); |
3329 | 90 |
23518 | 91 static octave_dld_function * create (octave_builtin::meth mm, |
92 const octave::dynamic_library& shl, | |
93 const std::string& nm = "", | |
94 const std::string& ds = ""); | |
95 | |
21750
6720e5a220ba
use namespace for octave_shlib class
John W. Eaton <jwe@octave.org>
parents:
21730
diff
changeset
|
96 octave::dynamic_library get_shlib (void) const |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
97 { return m_sh_lib; } |
9960
5f3c10ecb150
implement get_current_shlib and octave_auto_shlib
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
98 |
3329 | 99 private: |
100 | |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
101 octave::dynamic_library m_sh_lib; |
3329 | 102 |
103 // The time the file was last checked to see if it needs to be | |
104 // parsed again. | |
30864
5fa3d8f0dcb3
don't use mutable keyword for dld_function and mex_function data members
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
105 octave::sys::time m_time_checked; |
3329 | 106 |
107 // True if this function came from a file that is considered to be a | |
108 // system function. This affects whether we check the time stamp | |
109 // on the file to see if it has changed. | |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
110 bool m_system_fcn_file; |
3329 | 111 |
4612 | 112 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
3329 | 113 }; |
114 | |
115 #endif |