GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-dld-fcn.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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
39class octave_value;
41
42// Dynamically-linked functions.
43
44class OCTINTERP_API octave_dld_function : public octave_builtin
45{
46public:
47
49 : m_sh_lib (), m_time_checked (), m_system_fcn_file ()
50 { }
51
53 const octave::dynamic_library& shl,
54 const std::string& nm = "",
55 const std::string& ds = "");
56
58 const octave::dynamic_library& shl,
59 const std::string& nm = "",
60 const std::string& ds = "");
61
62 OCTAVE_DISABLE_COPY_MOVE (octave_dld_function)
63
65
66 void mark_fcn_file_up_to_date (const octave::sys::time& t)
67 { m_time_checked = t; }
68
69 std::string fcn_file_name () const;
70
71 octave::sys::time time_parsed () const;
72
73 octave::sys::time time_checked () const { return m_time_checked; }
74
75 bool is_system_fcn_file () const { return m_system_fcn_file; }
76
77 bool is_builtin_function () const { return false; }
78
79 bool is_dld_function () const { return true; }
80
81 static octave_dld_function * create (octave_builtin::fcn ff,
82 const octave::dynamic_library& shl,
83 const std::string& nm = "",
84 const std::string& ds = "");
85
86 static octave_dld_function * create (octave_builtin::meth mm,
87 const octave::dynamic_library& shl,
88 const std::string& nm = "",
89 const std::string& ds = "");
90
91 octave::dynamic_library get_shlib () const
92 { return m_sh_lib; }
93
94private:
95
96 octave::dynamic_library m_sh_lib;
97
98 // The time the file was last checked to see if it needs to be
99 // parsed again.
100 octave::sys::time m_time_checked;
101
102 // True if this function came from a file that is considered to be a
103 // system function. This affects whether we check the time stamp
104 // on the file to see if it has changed.
105 bool m_system_fcn_file;
106
108};
109
110#endif
octave_value_list(* fcn)(const octave_value_list &, int)
Definition ov-builtin.h:61
octave_value_list(* meth)(octave::interpreter &, const octave_value_list &, int)
Definition ov-builtin.h:58
octave::dynamic_library get_shlib() const
Definition ov-dld-fcn.h:91
octave::sys::time time_checked() const
Definition ov-dld-fcn.h:73
bool is_system_fcn_file() const
Definition ov-dld-fcn.h:75
void mark_fcn_file_up_to_date(const octave::sys::time &t)
Definition ov-dld-fcn.h:66
bool is_dld_function() const
Definition ov-dld-fcn.h:79
bool is_builtin_function() const
Definition ov-dld-fcn.h:77
virtual octave::sys::time time_parsed() const
Definition ov-fcn.h:96
virtual std::string fcn_file_name() const
Definition ov-fcn.h:74
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition ov-base.h:185