GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-dld-fcn.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-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_ov_dld_fcn_h)
27 #define octave_ov_dld_fcn_h 1
28 
29 #include "octave-config.h"
30 
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
45 OCTINTERP_API
47 {
48 public:
49 
51  : sh_lib (), t_checked (), system_fcn_file ()
52  { }
53 
55  const octave::dynamic_library& shl,
56  const std::string& nm = "",
57  const std::string& ds = "");
58 
60  const octave::dynamic_library& shl,
61  const std::string& nm = "",
62  const std::string& ds = "");
63 
64  // No copying!
65 
67 
69 
70  ~octave_dld_function (void);
71 
72  void mark_fcn_file_up_to_date (const octave::sys::time& t) { t_checked = t; }
73 
74  std::string fcn_file_name (void) const;
75 
76  octave::sys::time time_parsed (void) const;
77 
78  octave::sys::time time_checked (void) const { return t_checked; }
79 
80  bool is_system_fcn_file (void) const { return system_fcn_file; }
81 
82  bool is_builtin_function (void) const { return false; }
83 
84  bool is_dld_function (void) const { return true; }
85 
86  static octave_dld_function * create (octave_builtin::fcn ff,
87  const octave::dynamic_library& shl,
88  const std::string& nm = "",
89  const std::string& ds = "");
90 
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 
97  { return sh_lib; }
98 
99 private:
100 
102 
103  // The time the file was last checked to see if it needs to be
104  // parsed again.
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.
111 
113 };
114 
115 #endif
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
bool is_system_fcn_file(void) const
Definition: ov-dld-fcn.h:80
octave_dld_function(void)
Definition: ov-dld-fcn.h:50
octave::dynamic_library sh_lib
Definition: ov-dld-fcn.h:101
octave::sys::time t_checked
Definition: ov-dld-fcn.h:105
octave::dynamic_library get_shlib(void) const
Definition: ov-dld-fcn.h:96
bool is_dld_function(void) const
Definition: ov-dld-fcn.h:84
octave::sys::time time_checked(void) const
Definition: ov-dld-fcn.h:78
octave_dld_function(const octave_dld_function &fn)=delete
bool is_builtin_function(void) const
Definition: ov-dld-fcn.h:82
void mark_fcn_file_up_to_date(const octave::sys::time &t)
Definition: ov-dld-fcn.h:72
octave_value_list & operator=(const octave_value_list &obj)=default
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:158