1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_dynamic_ld_h) |
|
25 #define octave_dynamic_ld_h 1 |
1
|
26 |
2862
|
27 #include <string> |
|
28 |
3325
|
29 #include "oct-shlib.h" |
2894
|
30 |
|
31 class |
|
32 octave_dynamic_loader |
|
33 { |
|
34 protected: |
|
35 |
2926
|
36 octave_dynamic_loader (void) { } |
2894
|
37 |
|
38 public: |
|
39 |
2926
|
40 virtual ~octave_dynamic_loader (void) { } |
1
|
41 |
5864
|
42 static bool load_oct (const std::string& fcn_name, |
|
43 const std::string& file_name = std::string ()); |
|
44 |
|
45 static bool load_mex (const std::string& fcn_name, |
|
46 const std::string& file_name = std::string ()); |
3325
|
47 |
3523
|
48 static bool remove (const std::string& fcn_name, octave_shlib& shl); |
2894
|
49 |
|
50 private: |
|
51 |
|
52 // No copying! |
|
53 |
|
54 octave_dynamic_loader (const octave_dynamic_loader&); |
|
55 |
|
56 octave_dynamic_loader& operator = (const octave_dynamic_loader&); |
2926
|
57 |
|
58 static octave_dynamic_loader *instance; |
|
59 |
|
60 static bool instance_ok (void); |
|
61 |
5864
|
62 bool do_load_oct (const std::string& fcn_name, |
|
63 const std::string& file_name = std::string ()); |
|
64 |
|
65 bool do_load_mex (const std::string& fcn_name, |
|
66 const std::string& file_name = std::string ()); |
3325
|
67 |
3523
|
68 bool do_remove (const std::string& fcn_name, octave_shlib& shl); |
3325
|
69 |
|
70 static bool doing_load; |
2926
|
71 |
|
72 protected: |
|
73 |
3523
|
74 static std::string mangle_name (const std::string& name); |
2894
|
75 }; |
1
|
76 |
|
77 #endif |
|
78 |
|
79 /* |
|
80 ;;; Local Variables: *** |
|
81 ;;; mode: C++ *** |
|
82 ;;; End: *** |
|
83 */ |